469,572 Members | 1,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Retrieve a record from a table based on a combobox value which is of type date

I have a query like this...
Expand|Select|Wrap|Line Numbers
  1. rs.Open "select * from Tab_OrderStat_samp where wrkSlab=" & CmbOrdDt & "", cn, adOpenStatic, adLockOptimistic
but when a date is selected in the combo box which is there in the table the recordset is not filled by the particular record. In fact it shows recordcount as 0...but when we use count(*) it shows 1 record.

Please help me out so as to how to retrieve the record details...

thanks in advance
Rakesh
Nov 12 '09 #1

✓ answered by ChipR

Dates need to be surrounded by '#' in the SQL string.

4 1842
ChipR
1,287 Expert 1GB
Dates need to be surrounded by '#' in the SQL string.
Nov 12 '09 #2
NeoPa
32,198 Expert Mod 16PB
Please read the thread here
FAQ - How to Ask a Question
Your question uses language that makes it more difficult for our Experts to help you and wastes their time.

I see you are a new poster, but please check out our rules before posting again. I would prefer to avoid anything disciplinary so early on in your membership.

Administrator.
Nov 15 '09 #3
NeoPa
32,198 Expert Mod 16PB
The hash (#) is very important, but not the only important issue when dealing with date literals. See Literal DateTimes and Their Delimiters (#).
Nov 15 '09 #4
thank you that answers my question...
Nov 16 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Paolo | last post: by
1 post views Thread by A.J.M. van Rijthoven | last post: by
4 posts views Thread by Simon Gare | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.