Results 1 to 4 of 4
  1. #1
    Allaw212 is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    1

    Question How to display year season from date entry

    Hello

    I am quite stuck with creating a solution to display a season name (i.e summer, winter, etc) from when a user enters a Date



    How can i assign multiple values onto my "date" data type, and how can i eliminate specifying a year or perhaps set the year value to infinity??

    would i have to use If-Else statements, if so then how??

    please help

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I would probably create a table with two fields, one for the month (1) and the other for the related season (winter). You could then get the related season in a number of ways (query join, DLookup, etc).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Note that along with Paul's suggestion, you can/should use the "Month" function to find a month number from any given date. For example:

    MonthNo: Month([GivenDate])

    This will allow you to ignore the year and limit your lookup table "tlkpSeason" to only 12 records.

    Cheers,

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    It depends on how accurate you want to be. If I'm not mistaken, season changes occur on the 21st of the month. Technically, the entire month might not be part of 1 season. I think you'll want to format the date to remove the year (google the format function) and then run multiple if-else or switch statements to provide your seasons.

    ex. (psudo-code)

    If myDate Between beginDate And endDate Then
    season = "winter"

    etc...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Use field value as the year in a date
    By Eveline in forum Queries
    Replies: 1
    Last Post: 03-11-2010, 10:58 AM
  2. Date manipulaton for Financial Year
    By Neil Bingham in forum Access
    Replies: 0
    Last Post: 02-15-2009, 11:24 AM
  3. Changing a date to the current year
    By fdnyfish in forum Access
    Replies: 1
    Last Post: 03-01-2008, 08:34 AM
  4. Finding data between two date for any year
    By gemini2 in forum Access
    Replies: 4
    Last Post: 04-05-2006, 06:20 AM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums