Error 3141????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marylipscomb
    New Member
    • Apr 2007
    • 51

    Error 3141????

    I keep getting this error. EVerything looks like it is spelled correctly.

    My code is:



    SELECT [tbl_Company Visit].Rep, [tbl_Company Visit].Company As Company/Event, [tbl_Company Visit].CompanyInfoInd ustry As Industry,
    [tbl_Company Visit].CompanyInfoRes ponse As Response, [tbl_Company Visit].[Visit Type] As Activity,
    [Choices_County].County As County, [Choices_State].State As State, [tbl_Company Visit].Date
    FROM Choices_County, Choices_State, [tbl_Company Visit]
    Where ((([tbl_Company Visit].Date) Between [Start Date] And [End Date]))

    UNION SELECT [tbl_Marketing_A ctivity].Rep, [tbl_Marketing_A ctivity].[Event Name] As Company/Event,
    [tbl_Marketing_A ctivity].MarketingIndus try As Industry, [tbl_Marketing_A ctivity].MarketingRespo nse As Response,
    [tbl_Marketing_A ctivity].Activity As Activity, Null, Null, Null
    FROM [tbl_Marketing_A ctivity];


    TIA!!!!!!!!!!!! !!!
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Writing SQL is not really my long suit; the Design Grid usually surfices for my needs, but the error 3141 cites, among other things, the use of a reserved word.

    [tbl_Company Visit].Date

    would indicate that you have a field named Date which is a reserved word and a particularly dangerous one. See Reserved Words Especially Date and Time for details. You really need to change this field name, whether or not it's the casuative agent here. Sooner or later it will trip you up! Maybe that's the problem here!


    Linq ;0)>

    Comment

    • marylipscomb
      New Member
      • Apr 2007
      • 51

      #3
      Originally posted by missinglinq
      Writing SQL is not really my long suit; the Design Grid usually surfices for my needs, but the error 3141 cites, among other things, the use of a reserved word.

      [tbl_Company Visit].Date

      would indicate that you have a field named Date which is a reserved word and a particularly dangerous one. See Reserved Words Especially Date and Time for details. You really need to change this field name, whether or not it's the casuative agent here. Sooner or later it will trip you up! Maybe that's the problem here!


      Linq ;0)>

      That wasn't the problem at all. After reviewing my code and trying different things I figured out that it wanted Company/Event to be in brackets.
      [Company/Event]

      Thanks for your help though!!!

      Comment

      Working...