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. Database & SysAdmin
  3. Database
  4. How can I ?????????????

How can I ?????????????

Scheduled Pinned Locked Moved Database
databasequestion
3 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.
  • M Offline
    M Offline
    Mogaambo
    wrote on last edited by
    #1

    HI, In my database i am storing the date of birth of each user, but how can i create a query which give date of births of all user whose birthday month falls in the current month. that means if current month is march then the query should fetch the records of all users which are born in march. :confused::confused::confused::confused:

    S H 2 Replies Last reply
    0
    • M Mogaambo

      HI, In my database i am storing the date of birth of each user, but how can i create a query which give date of births of all user whose birthday month falls in the current month. that means if current month is march then the query should fetch the records of all users which are born in march. :confused::confused::confused::confused:

      S Offline
      S Offline
      sarvesh upadhyay
      wrote on last edited by
      #2

      Suppose create table TestBirth ( UserId int identity(1,1) ,UserName varchar(50) ,birthday datetime ) is the table which contains the records UserId UserName birthday 1 Manoj Singh 2008-02-02 00:00:00.000 2 Manoj singh2 1894-07-03 00:00:00.000 4 Anshu singh 1894-07-04 00:00:00.000 5 Garima singh 1894-07-13 00:00:00.000 6 Rajan singh 1894-07-14 00:00:00.000 7 Garima chaudhary 1894-07-03 00:00:00.000 8 Pankaj chaudhary 2008-03-03 00:00:00.000 Below query will help you Select UserName from testbirth where Month(birthday) = month(getdate())

      Sarvesh Upadhyay Senior Software Engineer Birlasoft India Ltd. Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application

      1 Reply Last reply
      0
      • M Mogaambo

        HI, In my database i am storing the date of birth of each user, but how can i create a query which give date of births of all user whose birthday month falls in the current month. that means if current month is march then the query should fetch the records of all users which are born in march. :confused::confused::confused::confused:

        H Offline
        H Offline
        hassanasp
        wrote on last edited by
        #3

        SELECT * from tablename where (@Month = month(Date) and @year = year(Date)) try this and give me feedback

        Ahmed hassan

        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