Help Please - Sql Compare Dates

Results 1 to 2 of 2

Thread: Help Please - Sql Compare Dates

  1. #1
    Join Date
    Dec 1969

    Default Help Please - Sql Compare Dates

    I am trying to get a group of records based on a season. So I feed the sql statement today&#039s date and want all the records to come back based on my season. Here is the code I am using:<BR><BR>SELECT Facts.Fact FROM Seasons INNER JOIN Facts ON Seasons.ID = Facts.SeasonID WHERE #12/1# Between Seasons.StartDate And Seasons.EndDate<BR><BR>12/1 is today&#039s date. This works except when I am in winter and above 1/1 because 1/1/00 is not between 12/1/00 and 2/1/00. Anyone know how I could fix this or another way to do this.

  2. #2
    Join Date
    Dec 1969

    Default Problem with year?

    It looks like your problem is that for this particular comparison, you should be using 1/1/01 and 2/1/01.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts