how get date from his parts

  • Thread starter Thread starter mttc
  • Start date Start date
M

mttc

have a 3 int varibles: y,m,d
how get Date from them?

this is the only way?

convert(smalldatetime,convert(varchar(4),@y) + '-' + convert(varchar(2),@m)
+
'-' + convert(varchar(2),@d))
 
Try:

DateSerial(y, m, d)

If y = 2004, m = 11, d = 17 it will return today's date.

HTH,
Nikos
 
Back
Top