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?
 
Joined
Jan 11, 2014
Messages
2
Reaction score
0
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" wrote:

> Tried that (query Builder)... keep getting an error message saying that my
> expression has a wrong number of arguments
>
> "Klatuu" wrote:
>
> > 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" wrote:
> >
> > > 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?
Hello Dave

I am an Access Novice and would like it to calculate the following,
I am trying to get it to calculate the following: if field [VATable Yes or No] = "Yes" then divide [Amount] / 6

I want it to calculate the VAT into the [Amount] field if yes is checked in the [VATable Yes or No] field,

Please help!!!
 

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