Syntax error in a query ?

Jean-Didier

New member
Local time
Today, 06:57
Joined
Mar 26, 2010
Messages
8
Hello,
I need your help please.
When i want to execute a query, i've got :
Syntax error (missing operator) in query expression '[Import temps_productifs_masques].'.

Here is the sql code :
Code:
[SIZE=2]SELECT [T_M Calendrier].Mois, [T_M Calendrier].[num sem], [T_M Calendrier].Date, [T_M PDE].Client, [T_M PDE].NAME, [T_M PDE].[FIRST NAME], [T_M Liste des Lucents].L1, [Import temps_productifs_masques].[Split/Skill], [Import temps_productifs_masques].[TEMPS STAFFE], [Import temps_productifs_masques].[STAFF-LUNCH], [Import temps_productifs_masques].[UNION], [Import temps_productifs_masques].DISPO, [Import temps_productifs_masques].BREAK, [Import temps_productifs_masques].LUNCH, [Import temps_productifs_masques].[SUP REQUEST], [Import temps_productifs_masques].MEETING, [Import temps_productifs_masques].TRAIN, [Import temps_productifs_masques].UNION , [Import temps_productifs_masques].DATA, [Import temps_productifs_masques].CONSULT, [Import temps_productifs_masques].OUTB FROM [T_M PDE] INNER JOIN ([T_M Liste des Lucents] INNER JOIN ([Import temps_productifs_masques] INNER JOIN [T_M Calendrier] ON [Import temps_productifs_masques].Date=[T_M Calendrier].Date) ON [T_M Liste des Lucents].L1=[Import temps_productifs_masques].Field3) ON [T_M PDE].Matricule=[T_M Liste des Lucents].Matricule;[/SIZE]

I have found a way to resolve it... I need to remove the field [import temps_productifs_masques].UNION for this query to work.. But i need this field.

Can you help me to resolve my probleme please ? (and sorry for my english... i'm french)

Thank you
 
Hello,
I need your help please.
When i want to execute a query, i've got :
Syntax error (missing operator) in query expression '[Import temps_productifs_masques].'.

Here is the sql code :
Code:
SELECT [T_M Calendrier].Mois, [T_M Calendrier].[num sem], [T_M Calendrier].Date, [T_M PDE].Client, [T_M PDE].NAME, [T_M PDE].[FIRST NAME], [T_M Liste des Lucents].L1, [Import temps_productifs_masques].[Split/Skill], [Import temps_productifs_masques].[TEMPS STAFFE], [Import temps_productifs_masques].[STAFF-LUNCH], [Import temps_productifs_masques].[UNION], [Import temps_productifs_masques].DISPO, [Import temps_productifs_masques].BREAK, [Import temps_productifs_masques].LUNCH, [Import temps_productifs_masques].[SUP REQUEST], [Import temps_productifs_masques].MEETING, [Import temps_productifs_masques].TRAIN, [Import temps_productifs_masques].UNION , [Import temps_productifs_masques].DATA, [Import temps_productifs_masques].CONSULT, [Import temps_productifs_masques].OUTB FROM [T_M PDE] INNER JOIN ([T_M Liste des Lucents] INNER JOIN ([Import temps_productifs_masques] INNER JOIN [T_M Calendrier] ON [Import temps_productifs_masques].Date=[T_M Calendrier].Date) ON [T_M Liste des Lucents].L1=[Import temps_productifs_masques].Field3) ON [T_M PDE].Matricule=[T_M Liste des Lucents].Matricule;

I have found a way to resolve it... I need to remove the field [import temps_productifs_masques].UNION for this query to work.. But i need this field.

Can you help me to resolve my probleme please ? (and sorry for my english... i'm french)

Thank you






I see a couple of things that are worth noting, although only one of them sticks out as an issue that could possibly create a problem like yours.
  • A lot of your Table and Column Names contain special characters (like Space and "/").
    • Although this Should not create a problem, this is not good practice and should be avoided if possible.

    [*]You have a Column whose name is the same as an Access Reserved Words [Date] and [UNION]
    • Although this Should not create a problem, this is not good practice and should be avoided if possible since Union is an Access Keyword and Date() is an Access Function.
  • In your Select statement, you duplicate the selection of the Column [Import temps_productifs_masques].[UNION], once with the Brackets, and once without.


    • This is most likely creating the problem, since Access cannot determine which column to label as Union. The first one will be called Union, and the second will be given an Alias (similar to Expr1). Again, this is not good practice and should be avoided if possible.
Since you do seem to need the second instance of the Union Column in your Select statement, then using an Alias for one or both of them is a suggested option. Post back if you need any further information.
 
Last edited:
Also another bad column name which needs to be in brackets is NAME. And BREAK is another one. Boy, and I just found another - DATA is a reserved word as well.

You might want to check your fields against this list of reserved words and not use them (preferable) or at least include them in square brackets.
 
Also another bad column name which needs to be in brackets is NAME. And BREAK is another one. Boy, and I just found another - DATA is a reserved word as well.

You might want to check your fields against this list of reserved words and not use them (preferable) or at least include them in square brackets.

I guess I missed those because I concentrated on the one that probably created the OP's problem. I hope the OP reviews the list of words to avoid.
 

Users who are viewing this thread

Back
Top Bottom