https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× Welcome to the ToolsJX forum!


Multiple Where statements

  • Webmuse
  • Webmuse's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #3524

Hi There,

I have a few issues that I hope you can assist with.

The first is that I need a grid to display data based on certain rules - I have this working fine using the WHERE option. But now, the client wants something that I am not sure how to achieve.

This is a sample of the current rule:

WHERE: province_physical IN ('3') AND reg_sec_title IN ('0') AND employment_practice_type IN ('Partnership','Sole proprietor','Company','CC','Other')

This is working perfectly. Now there is another field - cad_prof

So what we need is to have the data displayed if the reg_sec_title IN ('0') OR cad_prof IN ('0') BUT if I use the OR then it displays cad_prof data for all provinces and not just the province_physical IN ('3')

Does this make sense?

So Ideally I need to have two WHERE statements at the same time:

province_physical IN ('3') AND reg_sec_title IN ('0') AND employment_practice_type IN ('Partnership','Sole proprietor','Company','CC','Other' )

OR

province_physical IN ('3') AND cad_prof IN ('0') AND employment_practice_type IN ('Partnership','Sole proprietor','Company','CC','Other')

But these must both run on one table.

I am not very advanced with SQL so I dont know if this is at all possible.

Then my second question - is it possible to have the data in the grid display randomly - so not alphabetically ordered by field?

Many thanks

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.241 seconds

Contact Us

Contact us on Facebook