syntax for count text field

R

Revned

Hi,

I have a report bound in qryVendor
in this query I have a fieldname: Stat
with expression type

Stat:IIF([VDB]=[TlVDB])="Close","")

I want to count number of close in my report
I name it Total No of CLOSED PO:

can anyone is kind to help how to figure out


thanks in advance
 
R

Revned

Sorry Marshal barton if i make you confuse.
but here it is
in my qryVendor
my TlVBD field I set Total to Count
same with my VDB fied in my query

in my Stat fieldname
i set to Expression

Stat:IIF([VDB]=[TlVDB],"Close","")

I want to have exact syntax on how to SUM or COunt
number of records that has "Close" status
in my STAT Field....

Please need your help again

thanks


Marshall Barton said:
Revned said:
I have a report bound in qryVendor
in this query I have a fieldname: Stat
with expression type

Stat:IIF([VDB]=[TlVDB])="Close","")

I want to count number of close in my report
I name it Total No of CLOSED PO:


What are VDB and TIVDB?

Yout syntax is never going to work. The parenthesis are
unbalanced and the ([VDB]=[TlVDB]) part will either be True,
False or Null, none of which can ever be equal to "Close".

If you are trying to check if both VDB and TlVDB are equal
to "Close", then you should use:
IIf(VDB = "Close" And TlVDB = "Close", "", Null)

But even that seems odd to me. I think it best if you
explained what you are trying to do, instead of us guessing
what the the goal is.
 
D

Duane Hookom

To count the number of records where the two fields/columns have the same
value, use:
StatCount: Sum(Abs([VDB]=[TlVDB]))

Note: this only works in a totals query. I'm not sure if VDB and TIVDB are
allready aggregates or what you actual SQL is for the query or your actual
fields are.

--
Duane Hookom
MS Access MVP


Revned said:
Sorry Marshal barton if i make you confuse.
but here it is
in my qryVendor
my TlVBD field I set Total to Count
same with my VDB fied in my query

in my Stat fieldname
i set to Expression

Stat:IIF([VDB]=[TlVDB],"Close","")

I want to have exact syntax on how to SUM or COunt
number of records that has "Close" status
in my STAT Field....

Please need your help again

thanks


Marshall Barton said:
Revned said:
I have a report bound in qryVendor
in this query I have a fieldname: Stat
with expression type

Stat:IIF([VDB]=[TlVDB])="Close","")

I want to count number of close in my report
I name it Total No of CLOSED PO:


What are VDB and TIVDB?

Yout syntax is never going to work. The parenthesis are
unbalanced and the ([VDB]=[TlVDB]) part will either be True,
False or Null, none of which can ever be equal to "Close".

If you are trying to check if both VDB and TlVDB are equal
to "Close", then you should use:
IIf(VDB = "Close" And TlVDB = "Close", "", Null)

But even that seems odd to me. I think it best if you
explained what you are trying to do, instead of us guessing
what the the goal is.
 
R

Revned

Thank you I do appreciate your help

thank you very much

Duane Hookom said:
To count the number of records where the two fields/columns have the same
value, use:
StatCount: Sum(Abs([VDB]=[TlVDB]))

Note: this only works in a totals query. I'm not sure if VDB and TIVDB are
allready aggregates or what you actual SQL is for the query or your actual
fields are.

--
Duane Hookom
MS Access MVP


Revned said:
Sorry Marshal barton if i make you confuse.
but here it is
in my qryVendor
my TlVBD field I set Total to Count
same with my VDB fied in my query

in my Stat fieldname
i set to Expression

Stat:IIF([VDB]=[TlVDB],"Close","")

I want to have exact syntax on how to SUM or COunt
number of records that has "Close" status
in my STAT Field....

Please need your help again

thanks


Marshall Barton said:
Revned wrote:
I have a report bound in qryVendor
in this query I have a fieldname: Stat
with expression type

Stat:IIF([VDB]=[TlVDB])="Close","")

I want to count number of close in my report
I name it Total No of CLOSED PO:


What are VDB and TIVDB?

Yout syntax is never going to work. The parenthesis are
unbalanced and the ([VDB]=[TlVDB]) part will either be True,
False or Null, none of which can ever be equal to "Close".

If you are trying to check if both VDB and TlVDB are equal
to "Close", then you should use:
IIf(VDB = "Close" And TlVDB = "Close", "", Null)

But even that seems odd to me. I think it best if you
explained what you are trying to do, instead of us guessing
what the the goal is.
 

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