Forum Moderators: open
id ¦ builddate ¦ uniqueid
22 ¦ 05-02-2006 ¦ 55214112
23 ¦ 05-02-2006 ¦ 55214112
24 ¦ 05-03-2006 ¦ 88120774
25 ¦ 05-12-2006 ¦ 55214112
26 ¦ 05-12-2006 ¦ 88120774
25 ¦ 05-12-2006 ¦ 33332110
26 ¦ 05-12-2006 ¦ 66881244
I would like it to return only the '55214112' and '88120774' records because these have dates which are stamped today and have previous stamps. The other two only have stamps today so they are not valid.
Anyway of achieving this in an sql query?
You don't say what type of database you are using, so the syntax may vary. For SQL Server, CONVERT(char, GETDATE(), 101) will return 05/12/2006.
If your server is configured to return dates in the format you listed in the initial post, then that may be all you need to do. Otherwise you will need to play with the formatting and/or use the YEAR, MONTH, and DAY functions to build a string from today's date.