Contact US

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

MAS90 SQL syntax to ODBC

MAS90 SQL syntax to ODBC

MAS90 SQL syntax to ODBC

Hi All,

I'm a little confused how I'm supposed to construct my SELECT statements when requesting from tables in MAS90 ODBC.  I am using VB.NET to connect and get some data to compare. I can do normal select statements just fine, hoever in this case, I want to specify a result column of which data is greater, the last cost or average cost.  

I have tried:

SELECT IM1_InventoryMasterfile.ItemNumber, IFF(IM1_InventoryMasterfile.LastCost > IM1_InventoryMasterfile.AveCost,IM1_InventoryMasterfile.LastCost,IM1_InventoryMasterfile.AveCost) as 'Cost', IM1_InventoryMasterfile.TotalQtyOnHand
FROM IM1_InventoryMasterfile IM1_InventoryMasterfile

Error message= "Expected lexical element not found: FROM"


SELECT IM1_InventoryMasterfile.ItemNumber, CASE WHEN IM1_InventoryMasterfile.LastCost > IM1_InventoryMasterfile.AveCost THEN IM1_InventoryMasterfile.LastCost ELSE IM1_InventoryMasterfile.AveCost END as 'Cost', IM1_InventoryMasterfile.TotalQtyOnHand
FROM IM1_InventoryMasterfile IM1_InventoryMasterfile

Error message= "Didn't expect 'LastCost' after the SELECT column list."

Where am I going wrong here?

Thanks for your help

RE: MAS90 SQL syntax to ODBC

I agree with dawn... IFF is, I believe, specific to Microsoft Access.


Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg  http://parallel.tzo.com

RE: MAS90 SQL syntax to ODBC

is there a syntax reference that you know of for what I can use for the mas90 ODBC driver?

Can I use conditional if then statements?

RE: MAS90 SQL syntax to ODBC

No, the SOTAMAS90 ODBC driver has limited options. It does not support complex statements.

RE: MAS90 SQL syntax to ODBC

Thank you all.  Yes my best bet to do this in vb.net would be to pull all of the fields from mas90 into a data table, then do any complex select statements on the temporary data table i just created in vb.net.  that is definitely the long way, I'll  let you all know if that works out

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