![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? |
#3
| |||
| |||
|
|
Thomas Andersson wrote: I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? I thought bthis would do it but keep getting errors IIf([Sortie].[Result] = "RTB", "1", "0,5") |
#4
| |||
| |||
|
|
I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? In the query builder enter the column name, a colon, then expression. |
#5
| |||
| |||
|
|
What error? I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? I thought bthis would do it but keep getting errors IIf([Sortie].[Result] = "RTB", "1", "0,5") |
#6
| |||
| |||
|
|
Thomas Andersson wrote: I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? In the query builder enter the column name, a colon, then expression. Ex: [A] is Acronym NumVal : IIF([A]="RTB",1,IIF([A]="MIA",0,5)) Whats the diff between 0 and 5 values? |
#7
| |||
| |||
|
|
Thomas Andersson wrote: I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? I thought bthis would do it but keep getting errors IIf([Sortie].[Result] = "RTB", "1", "0,5") |
#8
| |||
| |||
|
|
I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? I thought bthis would do it but keep getting errors IIf([Sortie].[Result] = "RTB", "1", "0,5") Try using a period as a decimal point instead of a comma: IIf([Sortie].[Result] = "RTB", "1", "0.5") |
#9
| |||
| |||
|
|
Stuart McCall wrote: I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? I thought bthis would do it but keep getting errors IIf([Sortie].[Result] = "RTB", "1", "0,5") Try using a period as a decimal point instead of a comma: IIf([Sortie].[Result] = "RTB", "1", "0.5") Doubt it will help as I tried using 2 and 1 as values and get the same error. This is a headscratcher as according to all examples I've found this SHOULD be correct. Theer are no extra commas, all text and numbers are enclosed in quotes and the only operand is = which is legal.. so WHAT is Access complaining about?? Throwing mud at wall, try [Sortie]![Result]. Then try simply [Result]. |
#10
| |||
| |||
|
|
Douglas J. Steele wrote: Invalid Syntax, missing operand, non quoted text or invalid char/comma. What error? I'm making a query where I want to create a new column with a value based on another columns content The source will contain either of 4 3-letter acronyms (RTB, MIA, RES, KIA). the new coumn should check this and assign a value of 1 for RTB and 0,5 for all others. How would I do this? I thought bthis would do it but keep getting errors IIf([Sortie].[Result] = "RTB", "1", "0,5") |
![]() |
| Thread Tools | |
| Display Modes | |
| |