OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

switch true & false

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> switch true & false
Page: [1]
 
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 ...
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: switch true & false - 6/24/2009 11:11:43   
So you want to run a query that amends the data in the Access database so that when you finally bulk import the data will correspond?

_____________________________

:)

Follow us on TWITTER

(in reply to barking mad)
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 ...

(in reply to TexasWebDevelopers)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: switch true & false - 6/24/2009 16:00:04   
What is the format your are exporting to (that the bulk import program will import from)?

_____________________________

:)

Follow us on TWITTER

(in reply to barking mad)
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 ...

(in reply to TexasWebDevelopers)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> switch true & false
Page: [1]
Jump to: 1





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