[thelist] Quick SQL Assistance...
Tab Alleman
talleman at Lumpsum.com
Fri Nov 17 09:01:25 CST 2006
You're 90% there.
Convert(datetime,(CAST([Month] AS varchar)+'/1/'+CAST([Year] AS varchar))) BETWEEN @StartTime and @EndTime
Should do it.
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Rob Smith
> Sent: Friday, November 17, 2006 9:27 AM
> To: thelist at lists.evolt.org
> Subject: [thelist] Quick SQL Assistance...
>
>
> I've got two columns of type INT: Month, and Year.
>
> i.e.
>
> Month Year
>
> 1 2005
>
> 2 2006
>
> 3 2006
>
> 4 2007
>
> 5 2007
>
>
>
> I also have a start time parameter and an end time parameter. I need a
> WHERE statement that combines the two columns as a datetime
> format so I
> can invariably say:
>
>
>
> Convert(datetime,([Month]/1/[Year])) BETWEEN @StartTime and @EndTime
>
>
>
> Is there a way I can make the above happen?
>
>
> Rob Smith
> LexJet
> rob.smith at lexjet.com
> http://www.lexjet.com
> (800)453-9538
> (941)330-1210 Int'l
> (941)330-1220 Fax
> 1680 Fruitville Road, 3rd Floor
> Sarasota, FL 34236
>
> --
>
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>
More information about the thelist
mailing list