|
| |
|
|
barking mad
Posts: 287 Joined: 12/6/2002 From: Out in the sticks, UK Status: offline
|
switch true & false - 6/24/2009 8:06:43
in a nutshell: I'm writing a query which can be used to export data from client's access database that can be used ina bulk import program to update their online store. However they have a field called internet which as far as they're concerned if true means yes show on webshop, however my cart has a corresponding field called hide which if true hides the product from view on the web shop. So in otherwords the true statement has opposite meanings. I would like to amend my sql query on the access database to switch the true statement to false if true, and true if false... make sense? any ideas?
_____________________________
The more I ask, the more I learn, the more I' m confused, therefore the more I ask ...
|
|
|
|
barking mad
Posts: 287 Joined: 12/6/2002 From: Out in the sticks, UK Status: offline
|
RE: switch true & false - 6/24/2009 11:20:43
yes & convert the field which at teh moment is true or false to actually output the opposite ie true > false & false > true I've tried including case ... but get a syntax error here's my (abbreviated ie withou too many fields) code so far (i'm joining three tables)
SELECT tblProduct_Master.PLU AS catalogid,
tblProduct_Master.Internet AS nothide,
case tblProduct_Master.Internet when TRUE then FALSE when FALSE then TRUE end as hide
FROM (tblCategory INNER JOIN tblProduct_Master ON tblCategory.Category = tblProduct_Master.Category) INNER JOIN tblProduct_Master_StockLevel ON (tblProduct_Master.PLU = tblProduct_Master_StockLevel.PLU) AND (tblProduct_Master.PLU = tblProduct_Master_StockLevel.PLU)
ORDER BY tblProduct_Master.PLU;
The error is Syntax error (missing operator) in query expression 'case tblProduct_Master.Internet when TRUE then FALSE when FALSE then TRUE end'. when I cancel the tblProduct_Master is highlighted immediately AFTER the word case.
_____________________________
The more I ask, the more I learn, the more I' m confused, therefore the more I ask ...
|
|
|
|
barking mad
Posts: 287 Joined: 12/6/2002 From: Out in the sticks, UK Status: offline
|
RE: switch true & false - 6/25/2009 5:17:11
at the moment I'm just creating the initial Access DB query. It will then be manually exported as csv
_____________________________
The more I ask, the more I learn, the more I' m confused, therefore the more I ask ...
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|