Re: URGENT:SQL SERVER conveting date to integer



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 )

.