Can't quite get the SQL correct

CarlM1975

Registered User.
Local time
Today, 15:40
Joined
Oct 29, 2008
Messages
24
I have some code:

SQLTXT = "Select * from Qry_Budget " _
& "WHERE ((ManagerID =" & ManagerID And dbo_period.PERIOD <= "& Me.txtperiod)"

But I can not quite get the syntax right can anyone help. In english I need to take everything from qry budget where managerid = manager id and period <= me.txtperiod

Can this be done?

Thanks

Carl.
 
Try this

SQLTXT = "Select * from Qry_Budget " _
& "WHERE (ManagerID = '" & ManagerID & "' And dbo_period.PERIOD <= '" & Me.txtperiod & "')"

You may need to add a semicolon after the last )
 

Users who are viewing this thread

Back
Top Bottom