Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query using datetime field

Status
Not open for further replies.

celley

Programmer
Jul 31, 2000
54
0
0
A2
In one of my tables, I have a DateTime field. I want to write a query that will return distinct dates, regarless of the time. For example, if I had two entries in my table with the dates of:

'11/12/2001 4:23:00 PM' and
'11/12/2001 5:45:00 AM'

it would only retun one record of '11/12/2001'.

Thanks,
Chad
 
Try something like:

select distinct convert(varchar(11),datecolumn) from tablename

Rick.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top