Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kofseattle
Starting Member
8 Posts |
Posted - 2010-07-28 : 13:48:23
|
Hello,I need to create a field in my query based on an IIF statement and though I understand the basic IIF, I am challenged by this one. It's not so basic to me. In laymans terms;I need to check the field "shpLocations.LocationType" where location type is "Origin" and the "Region" is "USA" and check the field "shpLocations.LocationType" where location type is "DESTINATION" and the "Region" is "USA" IF both have a "Region" of "USA" the derived field should contain "DOMESTIC" if one or the other "REGIONS" is other than "USA" it should contain "INTERNATIONAL". Here is my feeble attempt, obviously it doesn't work, it was more for trying to get my goal accross to anyone who can help. Thanks in advance for any assistance!IIF(shpLocations.LocationType=ORIGIN AND shpLocations.Region=USA) AND (shpLocations.LocationType=DESTINATION AND shpLocations.Region=USA), 'Intl', 'Domestic') |
|
gavakie
Posting Yak Master
221 Posts |
Posted - 2010-08-17 : 15:21:21
|
Your missing your first '(' |
|
|
|
|
|