I have a database that I am doing some work on (which was writen by someone else)
One of the queries has some code in the Update which I cannot fully understand... I would be helpfull if someone can help in telling me what it is doing... plz
Firstly I shall give a discription of the fields involved:
[HRWEEK] : Number of hrs a course runs in a week
[BEGD] : Start date of a course
[EEND] : End Date of a course
[dtmTerm1_Start] : Start Date of Term 1
[dtmTerm1_End] : End Date of Term 1
[dtmTerm2_Start] : Start Date of Term 2
[dtmTerm2_End] : End Date of Term 2
[dtmTerm3_Start] : Start Date of Term 3
[dtmTerm3_End] : End Date of Term 3
The SQL is I need help explaining wats happening is:
UPDATE tblR1_Data, tblTerm SET tblR1_Data.AUTUMN = [HRWEEK]*IIf(([BEGD] Between [dtmTerm1_Start] And [dtmTerm1_End]),IIf(([EEND]<=[dtmTerm1_End]),DateDiff("ww",[BEGD],[EEND]),DateDiff("ww",[BEGD],[dtmTerm1_End])),0);
Another one I need help with is:
UPDATE tblR1_Data, tblTerm SET tblR1_Data.AUTUMN = [HRWEEK]*IIf(([BEGD] Between [dtmTerm1_Start] And [dtmTerm1_End]),IIf((DateDiff("d",[BEGD],[EEND]) Between 0 And 6),1,0),0)
WHERE (((tblR1_Data.AUTUMN)=0));
Thanks in advance
Neemi
One of the queries has some code in the Update which I cannot fully understand... I would be helpfull if someone can help in telling me what it is doing... plz
Firstly I shall give a discription of the fields involved:
[HRWEEK] : Number of hrs a course runs in a week
[BEGD] : Start date of a course
[EEND] : End Date of a course
[dtmTerm1_Start] : Start Date of Term 1
[dtmTerm1_End] : End Date of Term 1
[dtmTerm2_Start] : Start Date of Term 2
[dtmTerm2_End] : End Date of Term 2
[dtmTerm3_Start] : Start Date of Term 3
[dtmTerm3_End] : End Date of Term 3
The SQL is I need help explaining wats happening is:
UPDATE tblR1_Data, tblTerm SET tblR1_Data.AUTUMN = [HRWEEK]*IIf(([BEGD] Between [dtmTerm1_Start] And [dtmTerm1_End]),IIf(([EEND]<=[dtmTerm1_End]),DateDiff("ww",[BEGD],[EEND]),DateDiff("ww",[BEGD],[dtmTerm1_End])),0);
Another one I need help with is:
UPDATE tblR1_Data, tblTerm SET tblR1_Data.AUTUMN = [HRWEEK]*IIf(([BEGD] Between [dtmTerm1_Start] And [dtmTerm1_End]),IIf((DateDiff("d",[BEGD],[EEND]) Between 0 And 6),1,0),0)
WHERE (((tblR1_Data.AUTUMN)=0));
Thanks in advance
Neemi