G
gr
Hi,
I have this code:
...
....
Dim qd as QueryDef
set qd = db.QueryDefs("namequery")
....
....
qd.SQL = strNewSQL 'ERROR!!!
....
....
'end code
WHERE:
strNewSQL = "SELECT [tblMain].[ListID], [tblMain].
[OfferNo], [tblMain].[Von], [tblMain].[Bis], [OfferNo]" _
& " <" _
& "Format([Von], dd\.mm)" _
& " - " _
& "Format([Bis], dd\.mm)" _
& ">" _
& " AS OfferLabel, " _
& "[tblMain].[ProjectName],
[tblMain].[Keyword], [tblMain].[Status]" _
& "FROM tblMain" _
& " WHERE tblMain.Von Between
DateAdd(m, -6, Now()) And Now() " _
& " ORDER BY tblMain.Von;"
SOMETHING IS WRONG IN THE strNewSQL STRING, CAN ANYONE
HELP?
I THINK THE PROBLEM IS IN Format([Von], dd.mm) but I have
tried Format([Von], "dd.mm") and Format([Von], dd\.mm)
and Format([tblMain].[Von], dd.mm) , etc, etc..
any ideas?
I have this code:
...
....
Dim qd as QueryDef
set qd = db.QueryDefs("namequery")
....
....
qd.SQL = strNewSQL 'ERROR!!!
....
....
'end code
WHERE:
strNewSQL = "SELECT [tblMain].[ListID], [tblMain].
[OfferNo], [tblMain].[Von], [tblMain].[Bis], [OfferNo]" _
& " <" _
& "Format([Von], dd\.mm)" _
& " - " _
& "Format([Bis], dd\.mm)" _
& ">" _
& " AS OfferLabel, " _
& "[tblMain].[ProjectName],
[tblMain].[Keyword], [tblMain].[Status]" _
& "FROM tblMain" _
& " WHERE tblMain.Von Between
DateAdd(m, -6, Now()) And Now() " _
& " ORDER BY tblMain.Von;"
SOMETHING IS WRONG IN THE strNewSQL STRING, CAN ANYONE
HELP?
I THINK THE PROBLEM IS IN Format([Von], dd.mm) but I have
tried Format([Von], "dd.mm") and Format([Von], dd\.mm)
and Format([tblMain].[Von], dd.mm) , etc, etc..
any ideas?