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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top