Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Iam using the below condition in the script using where condition ..
Where (Pass_Year= Year(Today()) and Passmonth <= 12) AND (Pass_Year = Year(Today())-1 and Passmonth > 12);
This is giving me error..Please let me know if this is correct or needs to be changed ..
Thanks
Hi John,
The where clause looks fine. What is the error message?
Hi Nagaraj
Thanks for the reply ..when I reload this I get a error like
Unexpected expression error ')..
Iam confused with this
Pass_Year cannot be at the same time Year(Today()) and Year(Today())-1
your condition should be
Where (Pass_Year= Year(Today()) and Passmonth <= 12) OR (Pass_Year = Year(Today())-1 and Passmonth > 12);
One thing to note the Month cannot be greater than 12!!
This condition seems working fine when I tried with some dummy data. Can you share you sample that would make it easy to debug .
The condition is fine seems the issue is in some other part of script
Hi John,
I think the issue is not because of the where condition but some other part. Could you please post your script here.
HI Nagaraj.
My full where condition is below
where (Pass_year = Year(Today()) and passmonth <= 12) or (Pass_year = Year(Today())-1 and passmonth > 12)
and [Discription_Date] < if(WeekDay(today()) = 'Fri',today() - 3,
if(WeekDay(today()) = 'Sun', today() - 2,
today() - 1));
and the error is like missing field '<= >
John,
The above where condition is also looks fine to me . It looks like you have problem in passmonth field. Can you please check your passmonth field? Also If possible please share complete load statement.?
I believe you need this?
where ((Pass_year = Year(Today()) and passmonth <= 12) or (Pass_year = Year(Today())-1 and passmonth > 12))
and ([Discription_Date] < if(WeekDay(today()) = 'Fri',today() - 3, if(WeekDay(today()) = 'Sun', today() - 2, today() - 1)));