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 |
|
jbphoenix
Yak Posting Veteran
68 Posts |
Posted - 2008-12-17 : 15:57:43
|
| In the From part of my sql statement I am trying to limit the results to between Last year and the current year. My Transdate looks like this 20081217 (so it's yyyymmdd)Left(tblASSA_DetailStage.Transdate,6) between (left(tblASSA_DetailStage.Transdate,6)-100) and Left(@RptDate,6))For example, I need data up to today. I don't really care what the actual date of today is. I'm using for a Monthly report so I need everything in a month that's why I'm only taking the left 6 digits. So if I subtract 100 from 200812, I get 200712. Now I can see everything for a year. But when I run the query I get data that goes back to 2005. (that's when the first record was) So what I have is not working. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jbphoenix
Yak Posting Veteran
68 Posts |
Posted - 2008-12-17 : 16:05:08
|
| Correct it's an int |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jbphoenix
Yak Posting Veteran
68 Posts |
Posted - 2008-12-17 : 16:15:48
|
| Nope - but i have figured it out. thanks for trying i appreciate it |
 |
|
|
|
|
|