If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > cant get this boolean to work!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-04, 10:50
YevSnow YevSnow is offline
Registered User
 
Join Date: Mar 2004
Posts: 118
Red face cant get this boolean to work!!

Hi,

I'm trying to do a very simple query and one of the fields neest to be changed to "open" or "closed" if it starts with 'P'.

So I am writing this expression:

list: if(DwgType.Table = 'p*',"Open","Closed")

its returning an "undifined function "if" in expression" error.

I'm sure this is something really silly, but could someone give me a hand please?

Thanks
Reply With Quote
  #2 (permalink)  
Old 04-08-04, 10:55
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: cant get this boolean to work!!

Quote:
Originally posted by YevSnow
list: if(DwgType.Table = 'p*',"Open","Closed")
This is SQL???
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 04-08-04, 11:04
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
It smells like MS-Access (or more accurately, VBA) to me.

-PatP
Reply With Quote
  #4 (permalink)  
Old 04-12-04, 16:26
saqibmabbasi saqibmabbasi is offline
Registered User
 
Join Date: Mar 2004
Location: Karachi, Pakistan
Posts: 3
Hello YevSnow,
I dont know which tool you are using but i think you should try the following

ORIGINAL CODE:
list: if(DwgType.Table = 'p*',"Open","Closed")

CHANGED CODE: TRY 1

list: if(DwgType.Table LIKE 'p%',"Open","Closed")


I would like to know which tools do you use?
if this is Excel then i think the above code should work.
otherwise tell us the tools try and ask for our help.
Reply With Quote
  #5 (permalink)  
Old 04-13-04, 02:18
YevSnow YevSnow is offline
Registered User
 
Join Date: Mar 2004
Posts: 118
It's access yea, ops did i post on the wrong forum?

I tried the % it likes it even less. It seems to be a problem with the synthax... I'll repost this on the access vba forum.

Thanks everyone!
Reply With Quote
  #6 (permalink)  
Old 04-13-04, 11:18
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
For MS-Access you want iif() instead of if(). I guess somebody had keyboard-stutter... Actually, they wanted to distinguish between a VBA IF statement and the "Immediate If" function, but that was a VERY long time ago!

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On