- Local time
- Today, 22:59
- Joined
- Sep 28, 2010
- Messages
- 83
Folks, hopefully you might be able to help with this one...
I have a database to which I'm attempting to add some additional functionality. The database is already in use for building distribution lists of software upgrades to customers, based on the version of software that they're currently running.
The achieve this, I have a dynamically built query generated by a number of combo boxes.. (example below)
This version of the query excludes sites that are listed in do_not_send.Net_ID
What I would like to do is increase the size of the do_not_send table to allow for individual product choices (i.e. customer is happy to receive certain products, but not others, as network upgrades).. Therefore, I suspect I need some kind of IF statement to replace the "NOT IN" section to say, IF net_id present in do_not_send.net_id then verify whether do_not_send.*product* equals "yes" ... (for example)..
I appreciate that isn't written in fluent SQL, but I think you should get the gist of where I'm attempting to go with it!
Thanks in advance, please feel free to ask questions if you need additional info..
I have a database to which I'm attempting to add some additional functionality. The database is already in use for building distribution lists of software upgrades to customers, based on the version of software that they're currently running.
The achieve this, I have a dynamically built query generated by a number of combo boxes.. (example below)
Code:
SELECT Net_IDS.net_id
FROM (SYS INNER JOIN [SYS-VERS] ON [SYS].Version = [SYS-VERS].Version) INNER JOIN Net_IDS ON [SYS].Net_ID = Net_IDS.Net_ID
WHERE ((([SYS-VERS].Version_ID)>=(SELECT [SYS-VERS].Version_ID FROM [SYS-VERS] WHERE [SYS-VERS].Version = "2.88A/17"))) AND NET_IDS.NET_ID NOT IN (SELECT NET_ID FROM DO_NOT_SEND)
GROUP BY Net_IDS.Net_ID;
This version of the query excludes sites that are listed in do_not_send.Net_ID
What I would like to do is increase the size of the do_not_send table to allow for individual product choices (i.e. customer is happy to receive certain products, but not others, as network upgrades).. Therefore, I suspect I need some kind of IF statement to replace the "NOT IN" section to say, IF net_id present in do_not_send.net_id then verify whether do_not_send.*product* equals "yes" ... (for example)..
I appreciate that isn't written in fluent SQL, but I think you should get the gist of where I'm attempting to go with it!
Thanks in advance, please feel free to ask questions if you need additional info..
Last edited: