I am using SQl 2005.
I am trying to accomplish a simple view sql select using WHERE Clause conditional based on End of Month date
This is my View sql
Alter view view_name
as
select * from table
Where
Active_client = 'Y'
And sales = 1
AND (if day(getdate()) = 1 -- Beginning of new month
'01/ month(getdate()-1 / year(getdate()'
< client_date = <
'31/month(getdate()-1/Year(getdate()'
Else
do nothing
Can you please advice if this is possible ?
Please advice
Thank you
dre
I am trying to accomplish a simple view sql select using WHERE Clause conditional based on End of Month date
This is my View sql
Alter view view_name
as
select * from table
Where
Active_client = 'Y'
And sales = 1
AND (if day(getdate()) = 1 -- Beginning of new month
'01/ month(getdate()-1 / year(getdate()'
< client_date = <
'31/month(getdate()-1/Year(getdate()'
Else
do nothing
Can you please advice if this is possible ?
Please advice
Thank you
dre