Need a Query...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • learnaccess3
    New Member
    • Jan 2010
    • 7

    Need a Query...

    Dear Team,

    I need to write a query from one table say Employee in MS Access
    Following is Structure :
    Name,
    Emplyee Date of Birth = dd/mm/yyyy
    Extract Date= dd/mm/yyyy

    In this table Extract date field value will be same through the all rows. This field be refreshed after every 1 month.
    I need to take Month & Year from this field (Say Field Value for Extract Date is “11/30/2010”) so I need to write a query to find all the employees having date of Birth in Month Of Nov 2010.


    Thanks
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    The extract date is obsolete, as you need just all employees having a certain month of birth.
    The Extract date can always been "constructe d" by taking the "running" Year and Month...

    Check out the Format("datefie ld","format string") function to solve your query.

    Nic;o)

    Comment

    • learnaccess3
      New Member
      • Jan 2010
      • 7

      #3
      Thanks Nico. Will it work IF I need to take out teh value of Extract_Dt from another table with the same crieria.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        We first need to establish why you want to store the Extract date.
        If it's for securing to run the extraction only once a month, than an extra system table with the LastRun date can be an option.
        When you want to record which rows have been extracted with the run, than you need to record a LastExtracted date after the selection with an UPDATE query.
        Finally you can offer the user the most flexible solution by having them to choose the Month and you select dynamically those employees.
        For the "Month of Birth" only the month is needed, not the year :-)

        Clear ?

        Nic;o)

        Comment

        • learnaccess3
          New Member
          • Jan 2010
          • 7

          #5
          Dear Nico,

          The issue got resolved. Thank you very much.

          Regds

          Comment

          Working...