help to take value into a variable

vds_sandeep

New member
Local time
Today, 10:03
Joined
Jan 25, 2007
Messages
4
Hi All,

I declared a variable x, now i want to select count of rows of a table into x
i m new user and i tried like this
select count(*) into x from <table>;
y=x;
where y is another variable
but when i m executing this all code it will create a table as x and insert this count into x but i want to take value into variable x;

please help me...

Thanks in advance
 
Try this..

if y is a number then
x = nz(dcount("YourPrimaryKeyField","YourTable","WhichEverField=" & y ) ,0)

if y is a string then
x = nz(dcount("YourPrimaryKeyField","YourTable","WhichEverField='" & y & "'" ) ,0)

or with no Where
x = nz(dcount("YourPrimaryKeyField","YourTable", ) ,0)
 
sorry last one again...

or with no Where
x = nz(dcount("YourPrimaryKeyField","YourTable" ) ,0)
 

Users who are viewing this thread

Back
Top Bottom