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. compare date error

compare date error

Scheduled Pinned Locked Moved C#
databasequestionhelp
6 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.
  • A Offline
    A Offline
    angels777
    wrote on last edited by
    #1

    hi i tried to compare 2 dates where i stored both in database both dates are in mm/dd/yyyy format cmd.CommandText = "select birthday from contact where birthday- reminder <= 7"; how do i run that query ? thanks

    G L 3 Replies Last reply
    0
    • A angels777

      hi i tried to compare 2 dates where i stored both in database both dates are in mm/dd/yyyy format cmd.CommandText = "select birthday from contact where birthday- reminder <= 7"; how do i run that query ? thanks

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      If you are using Sql Server 2005 you can use DateDiff[^]

      Giorgi Dalakishvili #region signature my articles #endregion

      1 Reply Last reply
      0
      • A angels777

        hi i tried to compare 2 dates where i stored both in database both dates are in mm/dd/yyyy format cmd.CommandText = "select birthday from contact where birthday- reminder <= 7"; how do i run that query ? thanks

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        U can Put the value of Birthday and Reminder on Veriable then U can Easily Companre . Else u can use Datediff function :~9250168195 anubhava.prodata@gmail.com

        1 Reply Last reply
        0
        • A angels777

          hi i tried to compare 2 dates where i stored both in database both dates are in mm/dd/yyyy format cmd.CommandText = "select birthday from contact where birthday- reminder <= 7"; how do i run that query ? thanks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          U can Put the value of Birthday and Reminder on Veriable then U can Easily Companre . Else u can use Datediff function Anubhava Dimri 9250168195 anubhava.prodata@gmail.com

          A 1 Reply Last reply
          0
          • L Lost User

            U can Put the value of Birthday and Reminder on Veriable then U can Easily Companre . Else u can use Datediff function Anubhava Dimri 9250168195 anubhava.prodata@gmail.com

            A Offline
            A Offline
            angels777
            wrote on last edited by
            #5

            can i take ( 2/13/2008) - 3 days.. i cant use the datediff to deduct.. please help..

            L 1 Reply Last reply
            0
            • A angels777

              can i take ( 2/13/2008) - 3 days.. i cant use the datediff to deduct.. please help..

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Put the Value of Date in DateTime Variable Then U can easily deduct date value Like Dim var_date as datetime Var_date = "2/13/2008" var_Date = Var_Date.days - 3 Anubhava Dimri 9250168195 anubhava.prodata@gmail.com

              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