C
Coder 23
Below is a sample section of a table. It's sorted
by "Agent_ID ASC, Month_Reviewed ASC, Create_Date DESC,
Create_Time DESC;"
I'm trying to return only one unique month per agent which
is the most recent based on Create_Date and Create_Time.
Is there any way to do this in one shot(query)?
(the asterisks were added to indicate only the records
that should be returned.)
Agent_ID Month_Reviewed Create_Date Create_Time
15508 ** February 2003 9/29/2003 7:34:27 AM
15508 ** March 2003 9/29/2003 7:34:27 AM
15508 ** August 2003 8/26/2003 9:25:42 AM
15508 August 2003 8/1/2003 11:09:48 AM
15508 ** September 2003 9/29/2003 7:28:49 AM
15508 ** October 2003 11/6/2003 11:41:07 AM
15530 ** August 2003 8/26/2003 9:41:37 AM
15530 August 2003 8/26/2003 9:41:32 AM
15530 August 2003 8/1/2003 11:17:30 AM
15530 ** September 2003 9/29/2003 2:07:00 PM
15530 ** October 2003 11/7/2003 10:55:10 AM
26260 ** April 2003 9/29/2003 1:12:01 PM
26260 ** May 2003 9/29/2003 1:12:01 PM
26260 ** September 2003 9/29/2003 1:08:27 PM
26260 September 2003 9/2/2003 10:36:04 AM
26260 ** October 2003 11/3/2003 8:55:54 AM
Any suggestions are greatly appreciated.
Thanks.
by "Agent_ID ASC, Month_Reviewed ASC, Create_Date DESC,
Create_Time DESC;"
I'm trying to return only one unique month per agent which
is the most recent based on Create_Date and Create_Time.
Is there any way to do this in one shot(query)?
(the asterisks were added to indicate only the records
that should be returned.)
Agent_ID Month_Reviewed Create_Date Create_Time
15508 ** February 2003 9/29/2003 7:34:27 AM
15508 ** March 2003 9/29/2003 7:34:27 AM
15508 ** August 2003 8/26/2003 9:25:42 AM
15508 August 2003 8/1/2003 11:09:48 AM
15508 ** September 2003 9/29/2003 7:28:49 AM
15508 ** October 2003 11/6/2003 11:41:07 AM
15530 ** August 2003 8/26/2003 9:41:37 AM
15530 August 2003 8/26/2003 9:41:32 AM
15530 August 2003 8/1/2003 11:17:30 AM
15530 ** September 2003 9/29/2003 2:07:00 PM
15530 ** October 2003 11/7/2003 10:55:10 AM
26260 ** April 2003 9/29/2003 1:12:01 PM
26260 ** May 2003 9/29/2003 1:12:01 PM
26260 ** September 2003 9/29/2003 1:08:27 PM
26260 September 2003 9/2/2003 10:36:04 AM
26260 ** October 2003 11/3/2003 8:55:54 AM
Any suggestions are greatly appreciated.
Thanks.