syntax for count text field

  • Thread starter Thread starter Revned
  • Start date Start date
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
 
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.
 
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.
 
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.
 
Back
Top