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. using calendar for birthdays

using calendar for birthdays

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorial
9 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.
  • M Offline
    M Offline
    matjame
    wrote on last edited by
    #1

    Hello there guys.Im trying to use an aspx calendar and database to display birthdays.I have everyones ID numbers in the database so using that I want to display their birthdays on that specific day.For example today.I have to check everyone that celebrates today and display their names from a database. Please help guys.Thanx in advance

    kagiso

    V S 2 Replies Last reply
    0
    • M matjame

      Hello there guys.Im trying to use an aspx calendar and database to display birthdays.I have everyones ID numbers in the database so using that I want to display their birthdays on that specific day.For example today.I have to check everyone that celebrates today and display their names from a database. Please help guys.Thanx in advance

      kagiso

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      U will have to write Windows Service which will check Birthday Dates everyday morning or ur schedule time and so u can display this...

      M 1 Reply Last reply
      0
      • V varshavmane

        U will have to write Windows Service which will check Birthday Dates everyday morning or ur schedule time and so u can display this...

        M Offline
        M Offline
        matjame
        wrote on last edited by
        #3

        Cant I just use system date and compare that with the date in the database??

        kagiso

        C 1 Reply Last reply
        0
        • M matjame

          Cant I just use system date and compare that with the date in the database??

          kagiso

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

          I suspect the guy who answered you is joking, perhaps because what you're asking seems so straightforward. Yes, you can work out the age using DateTime.Now. And the DB gives you the dates to put in the date picker. So, which bit do you need help with ?

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          M 1 Reply Last reply
          0
          • C Christian Graus

            I suspect the guy who answered you is joking, perhaps because what you're asking seems so straightforward. Yes, you can work out the age using DateTime.Now. And the DB gives you the dates to put in the date picker. So, which bit do you need help with ?

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            M Offline
            M Offline
            matjame
            wrote on last edited by
            #5

            Thank you for your kindness.My problem is using the identity number from the database, i.e 840920 5993 081.I want to use this to establish when this person's birthday is.For example if its 841112 5993 081 then I should have a message that this person's birthday is today.And the same for those that celebrate tomorrow. Thank you so much again.

            kagiso

            C 1 Reply Last reply
            0
            • M matjame

              Thank you for your kindness.My problem is using the identity number from the database, i.e 840920 5993 081.I want to use this to establish when this person's birthday is.For example if its 841112 5993 081 then I should have a message that this person's birthday is today.And the same for those that celebrate tomorrow. Thank you so much again.

              kagiso

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

              So you're starting with the person's Id and want to know if just that person has a birthday ? So you want SQL like select Birthday from person where id='845834534' you can add a check for if the birthday is today or tomorrow, but you still need to check in code if it's today, or if it's tomorrow, so you may as well do all your checking there. getdate() is how you get today's date in T-SQL. But be careful, if you have a time component to either of the two dates you're checking, they won't be equal. DateDiff may be a better way to go.

              Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              M 1 Reply Last reply
              0
              • M matjame

                Hello there guys.Im trying to use an aspx calendar and database to display birthdays.I have everyones ID numbers in the database so using that I want to display their birthdays on that specific day.For example today.I have to check everyone that celebrates today and display their names from a database. Please help guys.Thanx in advance

                kagiso

                S Offline
                S Offline
                Sarani Ravindran
                wrote on last edited by
                #7

                Try this query from your database: SELECT Name from tablename where month(DOB)=month(getDate()) and day(DOB) = day(getdate()) God is always with you.

                M 1 Reply Last reply
                0
                • C Christian Graus

                  So you're starting with the person's Id and want to know if just that person has a birthday ? So you want SQL like select Birthday from person where id='845834534' you can add a check for if the birthday is today or tomorrow, but you still need to check in code if it's today, or if it's tomorrow, so you may as well do all your checking there. getdate() is how you get today's date in T-SQL. But be careful, if you have a time component to either of the two dates you're checking, they won't be equal. DateDiff may be a better way to go.

                  Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                  M Offline
                  M Offline
                  matjame
                  wrote on last edited by
                  #8

                  What I have in mind is take the first six and say sumthing like select Birthday from Person where the "month and day" = today. Then display the results or the person's name. i.e. if the first six = 831112 then I will take the 1112 and check that.The problem is I dont knw how to go about doing that.Hope u understand me

                  kagiso

                  1 Reply Last reply
                  0
                  • S Sarani Ravindran

                    Try this query from your database: SELECT Name from tablename where month(DOB)=month(getDate()) and day(DOB) = day(getdate()) God is always with you.

                    M Offline
                    M Offline
                    matjame
                    wrote on last edited by
                    #9

                    I will sure try this and see what I get

                    kagiso

                    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