Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / May 2008

Tip: Looking for answers? Try searching our database.

syntax error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dario90@gmail.com - 15 May 2008 08:19 GMT
i have a problem connected with syntax error- in query i have that:

SELECT DMax("Data","Pracownicy na stacjach","Lokalizacja stacji = " &
[Lokalizacja stacji] & "  And Zmiana = " &[Zmiana] & " And
Data<=#"&Data&"# ")
FROM Bledy;

(Translation: Pracownicy na stacjach= Emploees on work stations,
Lokalizacja stacji= Work station location, Zmiana=shift)

Only the criteria for Data work properly- for Zmiana and Lokalizacja
it returns syntax error. What can be the reason for that? Maybe the
fact that i'm looking for Data in this function and these 2 mistaken
criterias have text values not data.
Roger - 15 May 2008 11:21 GMT
On May 15, 1:19 am, dari...@gmail.com wrote:
> i have a problem connected with syntax error- in query i have that:
>
[quoted text clipped - 10 lines]
> fact that i'm looking for Data in this function and these 2 mistaken
> criterias have text values not data.

if Zmiana and Lokalizacja are text fields, you need single quotes,ie
SELECT DMax("Data","Pracownicy na stacjach","Lokalizacja stacji = '"
&
[Lokalizacja stacji] & "'  And Zmiana = '" &[Zmiana] & "' And
Data<=#"&Data&"# ")
FROM Bledy

so for example
 "Lokalizacja stacji = "
becomes
 "Lokalizacja stacji = '"
                               ^- this is a single quote, followed by
a double quote

"'  And Zmiana = '" &[Zmiana] & "'
^- double quote, single quote

"'  And Zmiana = '" &[Zmiana] & "'
                        ^- single quote, double quote

"'  And Zmiana = '" &[Zmiana] & "'
                                              ^- single quote, double
quote
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.