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. General Programming
  3. C#
  4. HOW TO RETRIVE ALL TRANSACTION from sqlserver where TODAYS DATE AS PARAMETER IN SQL QUERY.?

HOW TO RETRIVE ALL TRANSACTION from sqlserver where TODAYS DATE AS PARAMETER IN SQL QUERY.?

Scheduled Pinned Locked Moved C#
databasehelpquestion
6 Posts 4 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.
  • S Offline
    S Offline
    sudhir behera
    wrote on last edited by
    #1

    hi, i am passing datetime.now.tostring() as parMETER IN MY SQL QUERY for retriving all the transaction of todays.but unable to retrive. please help me. my query like: select billno,net amount from bill_details where date='" +DateTime.Now.Tostring() + "'; THANKS IN ADVANCE.

    K A P 3 Replies Last reply
    0
    • S sudhir behera

      hi, i am passing datetime.now.tostring() as parMETER IN MY SQL QUERY for retriving all the transaction of todays.but unable to retrive. please help me. my query like: select billno,net amount from bill_details where date='" +DateTime.Now.Tostring() + "'; THANKS IN ADVANCE.

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      Please do not repost: http://www.codeproject.com/Questions/74638/date-time-problem.aspx[^] Post either here or in Q&A, not both.

      Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter. Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

      1 Reply Last reply
      0
      • S sudhir behera

        hi, i am passing datetime.now.tostring() as parMETER IN MY SQL QUERY for retriving all the transaction of todays.but unable to retrive. please help me. my query like: select billno,net amount from bill_details where date='" +DateTime.Now.Tostring() + "'; THANKS IN ADVANCE.

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        Well, have you looked at what you are actually passing to the SQL? datetme.now.tostring() gives you the date AND time down to seconds, so unless your database date EXACTLY matches the system date and time nothing will be returned. 2 minutes in debug would have shown you that.

        Bob Ashfield Consultants Ltd

        1 Reply Last reply
        0
        • S sudhir behera

          hi, i am passing datetime.now.tostring() as parMETER IN MY SQL QUERY for retriving all the transaction of todays.but unable to retrive. please help me. my query like: select billno,net amount from bill_details where date='" +DateTime.Now.Tostring() + "'; THANKS IN ADVANCE.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Don't pass it as a string; use a parameter.

          K 1 Reply Last reply
          0
          • P PIEBALDconsult

            Don't pass it as a string; use a parameter.

            K Offline
            K Offline
            Keith Barrow
            wrote on last edited by
            #5

            Don't want Little Bobby Tables to make an appearance!

            Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter. Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

            P 1 Reply Last reply
            0
            • K Keith Barrow

              Don't want Little Bobby Tables to make an appearance!

              Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter. Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              If he does I'll kick his skinny white ass.

              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