Re: URGENT:SQL SERVER conveting date to integer
- From: "sriram" <sriram.ys@xxxxxxxxx>
- Date: 29 Jan 2007 20:36:13 -0800
On Jan 30, 9:31 am, "sriram" <sriram...@xxxxxxxxx> wrote:
On Jan 26, 10:01 am, "Steve" <morrisz...@xxxxxxxxxxx> wrote:
Usha wrote:
Hi
I have a date column.I want to convert this date to integer.Similarily
I want to convert current date to integer and find the difference
between these two dates
Please let me know regarding the same.
Regards
Usha
I'm not sure of your question...
SELECT CONVERT(int,GETDATE())
Hope this will also help you,
SELECT CONVERT(int, CONVERT(char(12),GETDATE(),12))
I thiknk you could better use the datediff function...that will surve
your purpose without any conversions. The syntax for the same would be
DATEDIFF ( datepart , startdate , enddate )
.
- References:
- URGENT:SQL SERVER conveting date to integer
- From: Usha
- Re: URGENT:SQL SERVER conveting date to integer
- From: Steve
- Re: URGENT:SQL SERVER conveting date to integer
- From: sriram
- URGENT:SQL SERVER conveting date to integer
- Prev by Date: Re: URGENT:SQL SERVER conveting date to integer
- Next by Date: Re: large SP performance difference between identical servers
- Previous by thread: Re: URGENT:SQL SERVER conveting date to integer
- Next by thread: large SP performance difference between identical servers
- Index(es):