TwelvestoneBack End

SQL Query Help


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
Tha.Riddla
 
2011-12-09

I'm assuming that this will be similar to MySQL, but I'm a big slacker with creating any type of query at the command line. I'm wondering how to do the following:

SELECT SalesOrderNo,OrderDate,OrderType,OrderStatus,[lots of columns here] FROM SO_SalesOrderHeader

With these limiters: ARDivisionNo IS 90 UDF_IN_SHIPPING IS TRUE (or 1 or whatever my boolean happens to be) OrderType IS NOT M,R,C (Master, Recurring, Complete)

is it the following?

SELECT SalesOrderNo,OrderDate,OrderType,OrderStatus,[lots of columns here] 
FROM SO_SalesOrderHeader
WHERE ARDivisionNo IN 90 
AND (UDF_IN_SHIPPING = 'TRUE')
AND (OrderType NOT IN (M,R,C))

Any thoughts?

Stinky
 
2011-12-09

I'm pretty sure that UDF_IN_SHIPPING IS TRUE is correct, and ARDivisionNo = 90 is what you're after. The rest looks ok.

I'm assuming MS SQL Server?

Tha.Riddla
 
2011-12-09

Yeah, it's actually for a shipping software that's connecting to our MRP/fulfillment software, so it's a Windows Server 2003 ODBC connection

//edit

So I'm looking for this as my final statement?

SELECT SalesOrderNo,OrderDate,OrderType,OrderStatus,[lots of columns here] 
FROM SO_SalesOrderHeader
WHERE ARDivisionNo = 90 
AND (UDF_IN_SHIPPING IS TRUE)
AND (OrderType NOT IN (M,R,C))
Stinky
 
2011-12-09

That seems right, it's been at least six years since I've done anything with MSSQL.

Deus Ex Machina
 
2011-12-09

seems right to me?

SQL is pretty logical. And your SQL query makes sense. So chances are it works.

Tha.Riddla
 
2011-12-10

nice. I'll test it out on Monday. I hope I break something real good!

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneBack End

SQL Query Help