M
matt donker via AccessMonster.com
Allright i am a semi new access database developer and i am tearing my hair
out at this one.
I want to run some SQL from vb using and in the where statement make it
compart to a variable. This is what i have (Well there is a ton more code
but this is what is significant)
Dim MonthNum$
Dim strSQL
MonthNum$ = DatePart("m", Date) - 1
strSQL = "DELETE * FROM [tblInventoryTaken] WHERE DatePart(m, Date Taken) =
MonthNum$"
Now i have changed so much around to try to get this thing to work and
regardless of what i do it always comes up with an error. One problem i am
having is that the date part statement you cannot use double quotes around
the m or you get and expected end of line error. Anyway if any of you can
help out i would sure appreciate it thanks.
Matt
out at this one.
I want to run some SQL from vb using and in the where statement make it
compart to a variable. This is what i have (Well there is a ton more code
but this is what is significant)
Dim MonthNum$
Dim strSQL
MonthNum$ = DatePart("m", Date) - 1
strSQL = "DELETE * FROM [tblInventoryTaken] WHERE DatePart(m, Date Taken) =
MonthNum$"
Now i have changed so much around to try to get this thing to work and
regardless of what i do it always comes up with an error. One problem i am
having is that the date part statement you cannot use double quotes around
the m or you get and expected end of line error. Anyway if any of you can
help out i would sure appreciate it thanks.
Matt