adding or substract one day if the date is sunday

basilyos

Registered User.
Local time
Today, 10:18
Joined
Jan 13, 2014
Messages
256
i have a table contains
1. full name
2. email
3. date

i want to make a query that will contain
1. full name
2. email
3. date1
4. date2

the date2 will be date1 + 90 days
so if the result is a sunday i want to add one day or substract one day automaticly

any help???
 
Try something like.
Code:
SELECT tableName.fullName, tableName.email, tableName.datField, 
DateAdd("d", tableName.datField, 90) + (Weekday(DateAdd("d", tableName.datField, 90)) = 1) As secondDate
FROM tableName;
 
i want to do this in a query expression not in vba
 
Ummmmm.... That is a Query Expression ??!?? Not VBA ! :eek:

Just copy the code (of course after replacing the tableName with the name of the table, and field names matching your design) into the SQL window of a Query builder. :rolleyes:
 
i write this and it works

Printing_Date_001: IIf(Weekday([Printing_Date_01])=1;[Printing_Date_01]+1;[Printing_Date_01])
 
I was under the impression..
so if the result is a sunday i want to add one day or substract one day automaticly

any help???
The code you have will check for if the First Date is a Sunday ! Is that not the other way around? :confused:
 
sorry coz i should ask my question with more details anyway it works

sorry again and thank you so much
 

Users who are viewing this thread

Back
Top Bottom