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.
Visual Basic.NET

Avatar of undefined
Last Comment
Member_2_4286571

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jini Jose

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
cyberkiwi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Member_2_4286571

ASKER
Excelent, fast and smart guys.
Your help has saved me hundreds of hours of internet surfing.
fblack61