Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Arrays/?

Status
Not open for further replies.

acr1

Programmer
Oct 12, 2001
73
NZ
Team
I have I assume an array that I need to incorporate in my SQL query... The scenario is as follows:...

Where the defect code = 1064 and SOR is in the range 18050 - 18999 (inclusive) then the fault code = 3133

Defect SOR Range Fault Code
1064 18050 - 18999 3133
1065 18050 - 18999 3131
1066 18050 - 18999 3200
1067 18050 - 18999 3132
1068 18050 - 18999 3207
1070 18050 - 18999 3107
1072 18050 - 18999 3200
1074 18050 - 18999 3101
1076 18050 - 18999 3200

If Anyone that can supply a workable solution asap that would be greatly appreciated.. The current equal join is not going to allow this, Is their a way to run this and hold the variables in memory...or would I need to run two separate queries.. (1 for the above info and 2 for the existing query I have.)

TIA
 
Depending upon your database type, you can probably just use a Select->Case to hardcode this into the SELECT of your SQL.

You can ignore the SOR range because it's all the same.

Or you can create a formula within Crystal, or best of all, create a reference/lookup table in your database and use a join.

You're probably best served using the appropriate SQL database forum for this sort of question.

-k kai@informeddatadecisions.com
 
I Have been giving this some more thought...the SOR range is only part of the total SOR range but is only the "18000" series. i.e others start at 10000,etc

I have been reading about 'Select Case' statements and would like to have a go...but perhaps a formula within Crystal might be appropriate..It is needed to populate a field within the report as it is run and then be part of a relational join...so do I run a 'function' before the query.

Perhaps some guidence and direction on 'stored functions' might help. As I have not yet resolved anybody with some assistance of any sort would be gladly appreciated.

The database is Oracle 8i.. and I am connecting via ODBC


TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top