SQL datetime problem

xphantg0d

Gawd
Joined
Jun 9, 2004
Messages
633
I am storing a date in sql as a smalldatetime. When my asp application retrieves it and puts it in a datagrid it shows the date and the time. (i.e. 8/12/2004 12:00:00 AM). The time is always 12:00:00 AM since no time is given to the server. I dont want to see the time. Is there a statement i can add to the view in sql to prevent this? or some code in asp i can add?
 
I dont know, I just use it. I use enterpise manager. I think the sql version is 8 or something.
 
It's not very pretty:

Code:
 <%= datepart("m",now()) & "/" & datepart("d",now()) & "/" & datepart("yyyy",now()) %>

Replacing the now()'s with your date value...

I think there's a more elegant way of doing it, but I've moved over to CF, and I'm slowly forgetting my ASP...
 
Back
Top