By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,282 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,282 IT Pros & Developers. It's quick & easy.

Help with date function

P: n/a
Can someone help me with this logic Iff "Current Quarter =1 then "Past
Quarter=4 Or If "Curent Quarter" = 2 Then "Past Quarter =1...and so
on.
I can find previous quarter base on my current quarter by using the
following lines of code. I don't know how the next coding for second
quarter.

SELECT tblSchedule.Adate, tblSchedule.Lot, tblSchedule.Qty,
tblSchedule.[Status Code], tblSchedule.[Product ID]
FROM tblSchedule
WHERE (((DatePart("q",[Adate]))=IIf(DatePart("q",Date())-1=0,4,DatePart("q",Date())-1))
AND ((Year([Adate]))=Year(Date()-365)))

Your help is really appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Look at the Switch and Choose functions in the Help file to see if they would
work for you.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Cathy" <ma*********@yahoo.com> wrote in message
news:9a*************************@posting.google.co m...
Can someone help me with this logic Iff "Current Quarter =1 then "Past
Quarter=4 Or If "Curent Quarter" = 2 Then "Past Quarter =1...and so
on.
I can find previous quarter base on my current quarter by using the
following lines of code. I don't know how the next coding for second
quarter.

SELECT tblSchedule.Adate, tblSchedule.Lot, tblSchedule.Qty,
tblSchedule.[Status Code], tblSchedule.[Product ID]
FROM tblSchedule
WHERE (((DatePart("q",[Adate]))=IIf(DatePart("q",Date())-1=0,4,DatePart("q",Date())-1)
) AND ((Year([Adate]))=Year(Date()-365)))

Your help is really appreciated.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.