Help With SQL Statement

Y

yes2man

Hi everyone...back to the well for help...

Here is the code:
strSQL = "SELECT * FROM [Walk Around Schedule: All Items] WHERE [Begin Date]
= #" & walkdate & "#"

Set rswalkaround = dbwalkaround.OpenRecordset(strSQL)

....where 'walkdate' is the value of a text field.

It works just fine BUT the recordset contains only the first record meeting
the criteria from the table, although I know there are multiple records that
meet the criteria in that table...what am I missing?

rswalkaround.recordcount returns 1!

Any/All help greatly appreciated!

Regards
yes2man
 
D

Douglas J. Steele

Your WHERE clause is only looking for a single date. Did you perhaps mean

"..WHERE [Begin Date] > #" & walkdate & "#"
 
Y

yes2man

THAT WAS IT!! Stupid...so deep didn't even see it...thanks a ton!

Daniel Pineault said:
You state :

rswalkaround.recordcount returns 1

Are you sure! Did you use rswalkaround.MoveLast before performing your
recordcount, if not your count will be invalid!

See: http://www.devhut.net/index.php?lang=en&pid=0000000011#recsets
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



yes2man said:
Hi everyone...back to the well for help...

Here is the code:
strSQL = "SELECT * FROM [Walk Around Schedule: All Items] WHERE [Begin Date]
= #" & walkdate & "#"

Set rswalkaround = dbwalkaround.OpenRecordset(strSQL)

...where 'walkdate' is the value of a text field.

It works just fine BUT the recordset contains only the first record meeting
the criteria from the table, although I know there are multiple records that
meet the criteria in that table...what am I missing?

rswalkaround.recordcount returns 1!

Any/All help greatly appreciated!

Regards
yes2man
 

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