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.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 IIF arguement help

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)).
Go to Top of Page

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?
Go to Top of Page

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 function
Also why do you use varchar datatype to store dates?


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -