×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Quick SQL syntax check (hopefully!)

Quick SQL syntax check (hopefully!)

Quick SQL syntax check (hopefully!)

(OP)
Can anyone tell me what's wrong with this SQL expression?

The error message is just a syntax error, so I'm sure it's easy if you speak SQL...

SELECT CASE WHEN "Variety" <> '' THEN "Date" || "Denomination" || "Variety" ELSE "Date" || "Denomination" END AS "Concat", "InventoryID" FROM "tblInventory"

RE: Quick SQL syntax check (hopefully!)

as far as ANSI SQL is concerned, i believe there is no error

so if you're getting a syntax error, it's because your particular database system isn't completely ANSI-compliant

what database system are you actually running, and what was the exact error message?

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon

RE: Quick SQL syntax check (hopefully!)

(OP)
Thank you r937, for your response!  I'm using OpenOffice Base 3.2, as I'm Access-phobic, and I'm trying to break away from Excel now that my lovely old database is too complex and too big for it.  Too much time spent watching it recalculate.

Turns out that I'd be better off using a COALESCE statement than the CASE or CASEWHEN.  OOBase would have been OK with CASEWHEN, apparently, but COALESCE is much tidier, and it works!

thanks a lot, and I'm sure this isn't the last you'll hear from me!

Declan

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close