Datepart year - + 6 months

W

Wayne-I-M

Hi

I hav a crostab query showing booking per year for ski trips but this is
making problems.

Ski trips need to be shown during the major season dates.
So any thing that has a departure date between August1st and the following
July
31st is that year -

1/11/09 = 2010 as it is after August 1st
2/2/09 = 2009 as it is previous to July 31st

Basically a ski season runs during the winter and anything during that
winter needs to be shown during the major season Jan Feb Mar of that year so
Nov and Dec are classed as the next year

Hope all this makes sense

so can't just use
TripYear: DatePart("yyyy",[tblEvents]![EVTStart])
as there may be a trip during November which would need to be shown as the
following year

any ideas
 
D

Douglas J. Steele

TripYear: IIf(Month([tblEvents]![EVTStart]) < 8,
DatePart("yyyy",[tblEvents]![EVTStart]),
DatePart("yyyy",[tblEvents]![EVTStart]) + 1)
 
W

Wayne-I-M

Thank you Douglas - excelent

When Mr Obama is finished I will vote for you and John Spencer


--
Wayne
Trentino, Italia.



Douglas J. Steele said:
TripYear: IIf(Month([tblEvents]![EVTStart]) < 8,
DatePart("yyyy",[tblEvents]![EVTStart]),
DatePart("yyyy",[tblEvents]![EVTStart]) + 1)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Wayne-I-M said:
Hi

I hav a crostab query showing booking per year for ski trips but this is
making problems.

Ski trips need to be shown during the major season dates.
So any thing that has a departure date between August1st and the following
July
31st is that year -

1/11/09 = 2010 as it is after August 1st
2/2/09 = 2009 as it is previous to July 31st

Basically a ski season runs during the winter and anything during that
winter needs to be shown during the major season Jan Feb Mar of that year
so
Nov and Dec are classed as the next year

Hope all this makes sense

so can't just use
TripYear: DatePart("yyyy",[tblEvents]![EVTStart])
as there may be a trip during November which would need to be shown as the
following year

any ideas
 
D

Douglas J. Steele

Being Canadian prevents me from being eligible. <g>

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Wayne-I-M said:
Thank you Douglas - excelent

When Mr Obama is finished I will vote for you and John Spencer


--
Wayne
Trentino, Italia.



Douglas J. Steele said:
TripYear: IIf(Month([tblEvents]![EVTStart]) < 8,
DatePart("yyyy",[tblEvents]![EVTStart]),
DatePart("yyyy",[tblEvents]![EVTStart]) + 1)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Wayne-I-M said:
Hi

I hav a crostab query showing booking per year for ski trips but this
is
making problems.

Ski trips need to be shown during the major season dates.
So any thing that has a departure date between August1st and the
following
July
31st is that year -

1/11/09 = 2010 as it is after August 1st
2/2/09 = 2009 as it is previous to July 31st

Basically a ski season runs during the winter and anything during that
winter needs to be shown during the major season Jan Feb Mar of that
year
so
Nov and Dec are classed as the next year

Hope all this makes sense

so can't just use
TripYear: DatePart("yyyy",[tblEvents]![EVTStart])
as there may be a trip during November which would need to be shown as
the
following year

any ideas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cross tab - complex IIF 2
Nulls in a crostab query 2

Top