Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. sql query

sql query

Scheduled Pinned Locked Moved ASP.NET
databasehelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jainiraj
    wrote on last edited by
    #1

    here is an sql query in which all fiels are correctly written- (select admin.*, brok.FirstName+' '+brok.LastName as BrokerName from adminmsgrecieved as admin,brokerdetails as brok where admin.AdminId='111' and brok.BrokerId=admin.FromBrokerId ) as custo(AdminId,FromBrokerId,FromCustId,Subject,DateOfMsg,Message,Status,MsgId,BrokerName) but i got an error "syntax error near as" what it may be?? plzz help.....

    M C 2 Replies Last reply
    0
    • J jainiraj

      here is an sql query in which all fiels are correctly written- (select admin.*, brok.FirstName+' '+brok.LastName as BrokerName from adminmsgrecieved as admin,brokerdetails as brok where admin.AdminId='111' and brok.BrokerId=admin.FromBrokerId ) as custo(AdminId,FromBrokerId,FromCustId,Subject,DateOfMsg,Message,Status,MsgId,BrokerName) but i got an error "syntax error near as" what it may be?? plzz help.....

      M Offline
      M Offline
      Member_3259094
      wrote on last edited by
      #2

      if you are concanating two columns then place it with in brakets like (brok.FirstName+' '+brok.LastName) as BrokerName Hope this will work fine.

      Rajeev Kr. Sharma Sr. Software Engineer E-Meditek Solutions Ltd. http://www.emeditek.co.in/

      J 1 Reply Last reply
      0
      • J jainiraj

        here is an sql query in which all fiels are correctly written- (select admin.*, brok.FirstName+' '+brok.LastName as BrokerName from adminmsgrecieved as admin,brokerdetails as brok where admin.AdminId='111' and brok.BrokerId=admin.FromBrokerId ) as custo(AdminId,FromBrokerId,FromCustId,Subject,DateOfMsg,Message,Status,MsgId,BrokerName) but i got an error "syntax error near as" what it may be?? plzz help.....

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Your SQL is broken. And so is your logic, this is not the SQL forum. Your from needs to be AFTER all the column specifications.

        Christian Graus Driven to the arms of OSX by Vista. Please read this[^] if you don't like the answer I gave to your question. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.

        1 Reply Last reply
        0
        • M Member_3259094

          if you are concanating two columns then place it with in brakets like (brok.FirstName+' '+brok.LastName) as BrokerName Hope this will work fine.

          Rajeev Kr. Sharma Sr. Software Engineer E-Meditek Solutions Ltd. http://www.emeditek.co.in/

          J Offline
          J Offline
          jainiraj
          wrote on last edited by
          #4

          No that is working fine.Problem is in "as custo(.....)".

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups