Archives of the TeradataForum
Message Posted: Tue, 29 Apr 2008 @ 22:38:32 GMT
Subj: | | Re: Case Statement and Crystal Reports |
|
From: | | cblake |
Hi Neetha -
I assume this is in the where clause of your SQL Statement, and the logic you are going for is - if it is the first day of the month, pull last
month, otherwise, pull the current month?
If so, I'd do it like this:
and extract(year from snpsht_dt) = extract(year from (current_date -
extract(day from current_date)))
and extract(month from snpsht_dt) = extract(month from (current_date -
extract(day from current_date)))
If you want to keep the logic more like you've got it, I believe you have to have the syntax more like:
and snpsht_dt > CASE Logic Here
and snpsht_dt < More CASE Logic here
|