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 |
Humate
Posting Yak Master
101 Posts |
Posted - 2008-01-16 : 13:34:52
|
Hi all,I have a report where I want to show a blank value if the date content of the field does not equal yesterday.The data is in varchar format.eg. IIF(Fields!Mydates.value <> "Yesterday", "", Fields!Mydates.value)The part "Yesterday" is where I am struggling to find the right code to basically do getdate()-1, which doesn't seem to work here. Any help much appreciated.Humate |
|
Humate
Posting Yak Master
101 Posts |
Posted - 2008-01-16 : 13:50:55
|
Scratch that - I think i found the answer i'm after with Today.AddDays(-1)). |
 |
|
Humate
Posting Yak Master
101 Posts |
Posted - 2008-01-16 : 14:11:42
|
This works with datetime columns, but not varchar. Anyone know how I do the same with varchar data type? |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-17 : 00:46:28
|
quote: Originally posted by Humate This works with datetime columns, but not varchar. Anyone know how I do the same with varchar data type?
Convert the varchar column into datetime and apply that functionAlso why do you use varchar datatype to store dates?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|