I am currently storing:
ReportMonth As tinyint
ReportDay As tinyint
ReportYear As tinyint
in my table. Client software requires that I have a "smalldatetime" column, which contains the date. I'd like to base it off the current 3 columns I have (seeing as how I have months worth of data)
I tried the following formula, as well as variations thereof:
(convert(smalldatetime, ReportYear + "-" + ReportMonth + "-" + ReportYear))
What is the correct formula for performing the calculation? I can't seem to get it.
Thanks for your help!You'd rather try:
convert(smalldatetime, convert(nvarchar,@.ReportMonth) + N"-" + convert(nvarchar, @.ReportDay + N"-" + convert(nvarchar,@.ReportYear))
Originally posted by odinsdream
I am currently storing:
ReportMonth As tinyint
ReportDay As tinyint
ReportYear As tinyint
in my table. Client software requires that I have a "smalldatetime" column, which contains the date. I'd like to base it off the current 3 columns I have (seeing as how I have months worth of data)
I tried the following formula, as well as variations thereof:
(convert(smalldatetime, ReportYear + "-" + ReportMonth + "-" + ReportYear))
What is the correct formula for performing the calculation? I can't seem to get it.
Thanks for your help!
Showing posts with label tinyintreportyear. Show all posts
Showing posts with label tinyintreportyear. Show all posts
Thursday, March 22, 2012
Subscribe to:
Posts (Atom)