October 18, 2017 at 12:48 pm
Morning All,
Iām stumped on a sqlquery and thought I might ask for some help. first time I'm trying this.
I'm trying to build a select query that pulls fields from 3 related tables (transactions,Destinatin,Rates) the Rates table has two particular columns [Rate A] and [Rate B] and I need to select either one of these based on a value in the Transaction table [Tonnage] column. So basically if the tonnage is <= 15 then select [Rate A] if not [Rate B]
I've joined the 3 tables , I'm think I should use a subquery in a case like below but I'm not sure how to put that together, or whether this is the best way to do it.
Case when tonnage >= 15 then subquery1 else subquery2
End
-------------------------------------------------------------------
I've attached sample of my script.
Any help is much appreciated.
October 18, 2017 at 1:59 pm
Thank you for your quick reply....yes that worked like a dream , I wish I had come here earlier.
Thanks ! š
January 7, 2021 at 9:36 am
This was removed by the editor as SPAM
January 7, 2021 at 9:38 am
This was removed by the editor as SPAM
April 22, 2021 at 8:55 pm
This was removed by the editor as SPAM
April 23, 2021 at 8:18 pm
This was removed by the editor as SPAM
April 23, 2021 at 8:19 pm
This was removed by the editor as SPAM
April 23, 2021 at 9:15 pm
This was removed by the editor as SPAM
April 23, 2021 at 9:16 pm
This was removed by the editor as SPAM
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply