Link to home
Start Free TrialLog in
Avatar of Member_2_4286571
Member_2_4286571

asked on

SQL LIKE problem

Hi.

I am trying to get some data from SQL database with this string:

strDate = CDate(mydate)
sql = "select NoRcpt from RcptMain where Dates LIKE '%@" & strDate & "%' order by NoRcpt DESC"

However nothing returns.

NoRcpt is Integer column (used as Identity)
Dates is Datetime column



There is data in that table, and number returned should be 1 but i am receving nothing so I guess the problem is in  Dates LIKE '%@" & strDate & "%'.

Please assist.

P.S. In string strDate looks like "14.11.2010" in database in Dates column that data is 14.11.2010. 0:00:00 that's why i am using LIKE. I could format database input to ignore hh:mm:ss but I will use that eventualy.
ASKER CERTIFIED SOLUTION
Avatar of Jini Jose
Jini Jose
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_4286571
Member_2_4286571

ASKER

Excelent, fast and smart guys.