HTML Status Window Question

Hi Everyone. I searched the forum, but couldn't find any answers, sorry if this is a very noob question:

We're using 1.3 1007 and RMSynergy. I've modified the html status window in the pos to show the customer loyalty points. There are actually two values. One is localpoints (the points accumulated at that store) and the other is loyaltypoints. Both draw from the RMSynergy tables that get added during the install.

I use those points to calculate a value the customer can redeem, but my problem is I can't seem to test for NO value for points in those tables, so my calculation bombs when it encounters an empty loyaltypoints or localpoints field.

I've tried using the standard tests for null, or isnull, but those tests fail, so even if the field is empty in those tables, it doesn't mean "null" as far as I can tell.

What's in those fields when they are empty, and how can I test for empty? I hope it isn't isempty...that's the only one I didn't try, but I didn't want to keep casting about...

Also, is there some kind of guide or manual for all the ins and outs of programming that status bar and the use of QSrules in these types of situations?

Reply to
Chris
Loading thread data ...

I'm sure that you are doing a SQL Select from Status.htm to get the point values. You can use the SQL function IsNull() to make sure that any null values in the row get a default value (0 would bake sense). However,you may be getting no rows and the IsNull() is not going to fix that. In that case you will probably need to modify your Select statement to include a LEFT Join on something like Customer where you know you will get a matching row.

Check out SQL Server Books on line at

formatting link
to get details on syntax. select c.AccountNumber, isnull(x.localPoints, 0), isnull(y.loyaltyPoints, 0) from Customer c Left Join localTable x on c.AccountNumber = x.SomeField Left Join loyaltyTable y on c.AccountNumber = y.SomeField Where c.AccountNumber = {The selected customer's account number}

Obviously, I have no idea what tables or fields you need to use in the join, but as long as there is a customer record, this query will return a row and the fields will not be null...

Glenn Adams Tiber Creek C> Hi Everyone. I searched the forum, but couldn't find any answers, sorry if

Reply to
Glenn Adams [MVP - Retail Mgmt

Oh, good point. There might not be a field to point to because the either the local or global Synergy loyalty table might not be populated for the matching Customer number.

So I should be able to test for eof -

Thanks Glenn,

"Glenn Adams [MVP - Retail Mgmt]" wrote:

Reply to
Chris

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.