Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Max函数的SQL查询_Sql_Ms Access - Fatal编程技术网

使用Max函数的SQL查询

使用Max函数的SQL查询,sql,ms-access,Sql,Ms Access,我有下表(示例)。我想获取项目编号、任务、任务日期,其中任务日期是最大日期/时间 因此,查询应返回: D001市场注册,2017年10月20日下午1:36:16 非常感谢您的帮助。谢谢 使用排序依据和顶部: select top 1 t.* from example as t order by task_date desc; 在A001 Plant Confir-@11:45 PM使用TOP与OrderIs not task date组合,并且应该是max,而不是D001@1:36 PM?第

我有下表(示例)。我想获取项目编号、任务、任务日期,其中任务日期是最大日期/时间

因此,查询应返回: D001市场注册,2017年10月20日下午1:36:16


非常感谢您的帮助。谢谢

使用
排序依据
顶部

select top 1 t.*
from example as t
order by task_date desc;

在A001 Plant Confir-@11:45 PM使用TOP与OrderIs not task date组合,并且应该是max,而不是D001@1:36 PM?第十二,是的-我手动输入了该日期/时间,并打算将其设置为AM-直到您指出后才注意到!ThxThanks Gordon-这让我得到了我所需要的-非常感谢!