Jump to content

SQL Query


sverkot

Recommended Posts

Hi,I want to know if there's a way to get the first and last records from a table.I'm using SQL server 2000 database.My question follows :SELECT createdate from TABLE WHERE agent_name = "JohnDoe" AND createDATE >='start_date' AND createdate <='end_date'This query will fetch me all the createdates for this agent like this. 2007-06-19 13:20:282007-06-19 13:59:56............................................................2007-06-19 23:56:482007-06-19 23:58:29My idea is to use the DateDiff function of vbscript to find the minutes between the first createdate and the last create so I can calculate how many hours this person worked. Is there a way to get the first and last record from the result of this query? Thanks,Sang.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...