If...then in .adp queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I just started working with .adp files and faced a problem. In the old .mdb
files I created the following field in a query:

HelpFieldA: IIF([FieldA]>1,[FieldA],[FieldB])

How do I make the equivalent in a .adp query?

Thanks...

GB, DK
 
hi,
I just started working with .adp files and faced a problem. In the old .mdb
files I created the following field in a query:
HelpFieldA: IIF([FieldA]>1,[FieldA],[FieldB])
How do I make the equivalent in a .adp query?
You are no longer writing queries. So you have to use the SQL Server
syntax called T-SQL:

CASE WHEN [FieldA]>1 THEN [FieldA] ELSE [FieldB] END

Take a look at CASE in the T-SQL documentation or in any kind of MSDN
Library.


mfG
--> stefan <--
 
Thank you, it works just perfect.

I must admit that I already got a documented example from witch I made the
following:
CASE [FieldA] WHEN 1 THEN [FieldA] ELSE [FieldB] END
Works perfect...

Next step
CASE [FieldA] WHEN >1 THEN [FieldA] ELSE [FieldB] END
Dosn't work at all...
With your example it is obvious. Thanks again :-)



Stefan Hoffmann said:
hi,
I just started working with .adp files and faced a problem. In the old .mdb
files I created the following field in a query:
HelpFieldA: IIF([FieldA]>1,[FieldA],[FieldB])
How do I make the equivalent in a .adp query?
You are no longer writing queries. So you have to use the SQL Server
syntax called T-SQL:

CASE WHEN [FieldA]>1 THEN [FieldA] ELSE [FieldB] END

Take a look at CASE in the T-SQL documentation or in any kind of MSDN
Library.


mfG
--> stefan <--
 
Back
Top