If Statement

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
dtester_(Guest)
Posts: 3
Joined: Tue Oct 10, 2017 12:44 pm

If Statement

Post by dtester_(Guest) » Wed Dec 26, 2007 1:41 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: If Statement

Post by kfleming » Mon Dec 31, 2007 12:28 pm

You can use the like function____IIF(LIKE("_08",CATCODE),...____will be true when CATCODE ends in 2008____Kathleen__R&R Support

Online Payday Loans
Posts: 0
Joined: Fri May 04, 2018 8:30 am

==> RE: If Statement

Post by Online Payday Loans » Fri Jan 04, 2008 12:26 pm

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__

Post Reply