expression with True of False showing up as -1 or 0

A

Agent_KGB

I have a simple expression (Contract Date > Date()) but i woul dlike to see
result as TRUE / FALSE or YES/NO however in my query it shows up as -1 or
0... how can i fix it?
 
K

Klatuu

In Your Query builder, use a calculated field:

SomeDate: IIf([Contract Date] > Date()), "YES", "NO")

in SQL it would be
SELECT IIf([Contract Date] > Date()), "YES", "NO") AS SomeDate .....
 
A

Agent_KGB

Tried that (query Builder)... keep getting an error message saying that my
expression has a wrong number of arguments

Klatuu said:
In Your Query builder, use a calculated field:

SomeDate: IIf([Contract Date] > Date()), "YES", "NO")

in SQL it would be
SELECT IIf([Contract Date] > Date()), "YES", "NO") AS SomeDate .....
--
Dave Hargis, Microsoft Access MVP


Agent_KGB said:
I have a simple expression (Contract Date > Date()) but i woul dlike to see
result as TRUE / FALSE or YES/NO however in my query it shows up as -1 or
0... how can i fix it?
 
K

Klatuu

Sorry it was a syntax error I got from copying your original expression. I
should have caught it. It should be:

SomeDate: IIf([Contract Date] > Date(), "YES", "NO")
--
Dave Hargis, Microsoft Access MVP


Agent_KGB said:
Tried that (query Builder)... keep getting an error message saying that my
expression has a wrong number of arguments

Klatuu said:
In Your Query builder, use a calculated field:

SomeDate: IIf([Contract Date] > Date()), "YES", "NO")

in SQL it would be
SELECT IIf([Contract Date] > Date()), "YES", "NO") AS SomeDate .....
--
Dave Hargis, Microsoft Access MVP


Agent_KGB said:
I have a simple expression (Contract Date > Date()) but i woul dlike to see
result as TRUE / FALSE or YES/NO however in my query it shows up as -1 or
0... how can i fix it?
 
A

Agent_KGB

Dave, you ROCK!!!

Klatuu said:
Sorry it was a syntax error I got from copying your original expression. I
should have caught it. It should be:

SomeDate: IIf([Contract Date] > Date(), "YES", "NO")
--
Dave Hargis, Microsoft Access MVP


Agent_KGB said:
Tried that (query Builder)... keep getting an error message saying that my
expression has a wrong number of arguments

Klatuu said:
In Your Query builder, use a calculated field:

SomeDate: IIf([Contract Date] > Date()), "YES", "NO")

in SQL it would be
SELECT IIf([Contract Date] > Date()), "YES", "NO") AS SomeDate .....
--
Dave Hargis, Microsoft Access MVP


:

I have a simple expression (Contract Date > Date()) but i woul dlike to see
result as TRUE / FALSE or YES/NO however in my query it shows up as -1 or
0... how can i fix it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top