Page 1 of 1

If Statement

Posted: Wed Dec 26, 2007 1:41 pm
by dtester_(Guest)
I am using the R&R for SQL. I have the latest version of R&R and using SQL 2005.____When I do an if statement like IIF(CATCODE = "*2008), true statement, false statement). (I am using a wildcard to say any catalog code that ends in 2008) I do not get any results. If I do a statement that says IIF(CATCODE = "SD2008", etc) I get results. I assume SQL does not like the equal sign. I know in my filters I had to go to using "LIKE".____Is there another way to do the iff statements?____Thank you,__David Tester

=> RE: If Statement

Posted: Mon Dec 31, 2007 12:28 pm
by kfleming
You can use the like function____IIF(LIKE("_08",CATCODE),...____will be true when CATCODE ends in 2008____Kathleen__R&R Support

==> RE: If Statement

Posted: Fri Jan 04, 2008 12:26 pm
by Online Payday Loans
Kathleen that worked great. We are converting over from MOM dbase to MOM SQL. So we are converting all of our reports. One more question if I may. I run a report using dates where I compare this year to last year. My if statement is "IIF(IT_SDATE>={10/01/2006} AND IT_SDATE<=Date_rr-365,ITEMS.GROSS,0)"____My problem is with this portion, IT_SDATE<=Date_rr-365. It does not like the date-rr-365. If i put in a specific date such as {12/31/2007} works great, if I just put in date_rr it works great. ____My goal is to run a report that figures sales for a time period this year and figure the sales for the same time last year - that is why i use the date_rr-365 is to figure today^s date last year. I have tried a calculation filed called LYToday and put in the calculation Date_rr-365 and that did not work either.____Any ideas__