Good afternoon,
I have a query that runs in excel pulling data from an access table, but I need to pull data through as long as it doesnt match a criteria.
So if person 1 loads the information it is specific to them, but if say the manager loads the file it does something else based on a cell reference
The code below works if the "Business2" is a simple name, but I need it to pull anything other than the name in Business2
The second line just pulls through the referenced information in Business2 where I need it to pull anything but.
ie line one pulls the specific name, but line 2 I need to pull everything bar the name if that makes sense.
What syntax am I missing to make the code understand the difference?
thanks in a advance
gavin
I have a query that runs in excel pulling data from an access table, but I need to pull data through as long as it doesnt match a criteria.
So if person 1 loads the information it is specific to them, but if say the manager loads the file it does something else based on a cell reference
The code below works if the "Business2" is a simple name, but I need it to pull anything other than the name in Business2
The second line just pulls through the referenced information in Business2 where I need it to pull anything but.
ie line one pulls the specific name, but line 2 I need to pull everything bar the name if that makes sense.
What syntax am I missing to make the code understand the difference?
Code:
works
FROM ObservationTable WHERE ((ObservationTable.Business) = '" & Business2 & "') And ((ObservationTable.[Marking Date]) between " & Chr(35) & date1 & Chr(35) & " AND " & Chr(35) & date2 & Chr(35) & " );"
doesnt work
FROM ObservationTable WHERE ((ObservationTable.Business) <> '" & Business2 & "') And ((ObservationTable.[Marking Date]) between " & Chr(35) & date1 & Chr(35) & " AND " & Chr(35) & date2 & Chr(35) & " );"
thanks in a advance
gavin