Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Msandlana
Starting Member
33 Posts |
Posted - 2008-02-12 : 03:41:57
|
| Hi All I want anyone that could help me with the query to select the sales that start from last year 2007, march up to the end of january this year 2008.It would be easy If I have the full date.you would say WHERE DATE BETWEEN '2007/03/01' AND '2008/01/31' But I only have the Year int, Month integ: Select * from Runtot_MenuName_MonthWhere ?I tried so many times but I can't get the correct results |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-12 : 03:54:02
|
You have two column of datatype INT, one for YEAR and one for MONTH?SELECT *FROM Table1WHERE 100 * YEAR + MONTH BETWEEN 200703 AND 200801 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-02-12 : 03:57:43
|
Oh . . . i read it as the Year int and Month int as input value  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-12 : 03:59:54
|
It is still possible. OP is not that clear in his problem description. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Msandlana
Starting Member
33 Posts |
Posted - 2008-02-12 : 04:07:22
|
| Thank You very much peso its working |
 |
|
|
|
|
|