sql correct sintax for delete a record from the date

Hi you guys what is the correct syntax for delete a record from sql statement like this


 sqlstring = " delete from masacor where folio= " & regact & " and dia='18/04/2005'"  

the error is
Data type mismatch
thnx
Ernesto
ErnestoAsked:
Who is Participating?
 
Éric MoreauSenior .Net ConsultantCommented:
if folio is of character type, it has to be surrounded by single quotes

sqlstring = " delete from masacor where folio= '" & regact & "' and dia='18/04/2005'"  

If your database is Access, the date needs to be surrounded with #

sqlstring = " delete from masacor where folio= " & regact & " and dia=#18/04/2005#"  
0
 
ErnestoAuthor Commented:
Thats it
tnks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.