how to get date without time 
Author Message
 how to get date without time

I'm trying to get the system date without having the time
portion.  How would I do this?

Thanks,

Jon Greisz



Mon, 18 Sep 2000 03:00:00 GMT
 how to get date without time

Use this:

select convert(convert(char(8),getdate(),112),datetime)

In short, convert to a char with only the year and put it back into a
datetime. It will have a time of 12:00AM. If you do this consistently,
then all your date comparisons will be OK.

Yes, you can also use combinations of datepart to pick out the 3 pieces
of the date and put them back together. This is simpler.

There are no separate date and time datatypes in Sybase.

You may want to look at this too:

http://sybooks.sybase.com/cgi-bin/nph-dynaweb/asg1150e/sqlug/1.toc

Quote:

> I'm trying to get the system date without having the time
> portion.  How would I do this?

> Thanks,

> Jon Greisz




Mon, 18 Sep 2000 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Getting Date without Time

2. Getting Just the Date (without the time)

3. Getting Date/Time from LAN Machine and Setting Date/Time on Client

4. Getting the date value of a date/time field

5. Date column without the Time information in SQL 7

6. Dates without times and select

7. Comparing two dates without time

8. Easier way to get Date without Time?

9. how to get date without time

10. Saving default date without time (or other method)

11. Date without time

12. I need date without Time


 
Powered by phpBB® Forum Software