Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    55

    Unanswered: InValid use of Vertcal bars

    I have this query expression and i get an error message everytime I try to save the query. The message: "Invalid use of vertical bars in query expression '[WO Header].Status || [WO Header].[Hold type]'". Any suggestions would be great.

    Thanks,

    Animaul

    INSERT INTO tblTempWOSummery
    SELECT Left([WO Header].[WO #],5) AS Test, [WO Header].[WO #] AS [WO #], [WO Header].[Job #] AS [Job #], [WO Header].Description AS Description, [WO Header].[Due Date] AS [Due Date], [WO Header].Status AS Status, [WO Header].[WO Close] AS [WO Close], [WO Header].Site AS Site, Sum([WO Instr]![Run Hrs]) AS Expr1, Sum([WO Instr]![Actual Hrs]) AS Expr7, Max([WO Header]![Qty]) AS Expr2, [Expr1]*[Expr2]+Sum([WO Instr]![SU Hrs]) AS Expr3, [WO Header].[Hold type] AS [Hold type], Sum([WO Instr]![Actual Hrs]) AS Exp4, IIf([WO Header]![Status]<>5,[expr3],0) AS Expr4, [WO Header].Status || [WO Header].[Hold type] as StatusFlag
    FROM [WO Header] INNER JOIN [WO Instr] ON [WO Header].[WO #] = [WO Instr].[WO #]
    GROUP BY Left([WO Header].[WO #],5), [WO Header].[WO #], [WO Header].[Job #], [WO Header].Description, [WO Header].[Due Date], [WO Header].Status, [WO Header].[WO Close], [WO Header].Site, [WO Header].[Hold type]
    HAVING ((([WO Header].[WO #]) Like [ENTER WO#]) AND (([WO Header].[Job #]) Like [ENTER JOB#]));

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: InValid use of Vertcal bars

    Originally posted by Animaul
    I have this query expression and i get an error message everytime I try to save the query. The message: "Invalid use of vertical bars in query expression '[WO Header].Status || [WO Header].[Hold type]'". Any suggestions would be great.

    Thanks,

    Animaul

    INSERT INTO tblTempWOSummery
    SELECT Left([WO Header].[WO #],5) AS Test, [WO Header].[WO #] AS [WO #], [WO Header].[Job #] AS [Job #], [WO Header].Description AS Description, [WO Header].[Due Date] AS [Due Date], [WO Header].Status AS Status, [WO Header].[WO Close] AS [WO Close], [WO Header].Site AS Site, Sum([WO Instr]![Run Hrs]) AS Expr1, Sum([WO Instr]![Actual Hrs]) AS Expr7, Max([WO Header]![Qty]) AS Expr2, [Expr1]*[Expr2]+Sum([WO Instr]![SU Hrs]) AS Expr3, [WO Header].[Hold type] AS [Hold type], Sum([WO Instr]![Actual Hrs]) AS Exp4, IIf([WO Header]![Status]<>5,[expr3],0) AS Expr4, [WO Header].Status || [WO Header].[Hold type] as StatusFlag
    FROM [WO Header] INNER JOIN [WO Instr] ON [WO Header].[WO #] = [WO Instr].[WO #]
    GROUP BY Left([WO Header].[WO #],5), [WO Header].[WO #], [WO Header].[Job #], [WO Header].Description, [WO Header].[Due Date], [WO Header].Status, [WO Header].[WO Close], [WO Header].Site, [WO Header].[Hold type]
    HAVING ((([WO Header].[WO #]) Like [ENTER WO#]) AND (([WO Header].[Job #]) Like [ENTER JOB#]));
    Are you trying to do a logical OR on these: [WO Header].Status || [WO Header].[Hold type] as StatusFlag

  3. #3
    Join Date
    Nov 2003
    Posts
    55
    No I was trying to concatinate the two fields together. My SQL text had said to use || to concatinate.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Animaul
    No I was trying to concatinate the two fields together. My SQL text had said to use || to concatinate.
    Ah ... Use the "&" sign instead.

    Change: [WO Header].Status || [WO Header].[Hold type]

    To: [WO Header].Status & [WO Header].[Hold type]

  5. #5
    Join Date
    Nov 2003
    Posts
    55
    My text is for straight SQL. Is that the reason the vertical bars would not work?

    Thanks that hit the spot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •