While doing my due diligence on the subject I thought Iβd toss it out here in case someone already has a function handy that will do this, thus saving me the effort of thinking too hard too early in the day. π
Hereβs the goal. I want to take a date, say today, Tuesday May 8, 2018 and figure out how to return Tuesday, May 9, 2017 or Tuesday May 10, 2016, etc. This is so I can do some year over year comparisons to transactions that occurred on the same day of the week a year ago.
TIA
--
rk
clear set century on
dDate=Date()
? DateAdd("YY", 5, dDate) ? DateAdd("WEEK", 5, dDate)
* return
* Mirrors TSQL DateAdd() Function * Example: * ? DateAdd("YY", 2, Date()) * Function DateAdd(tcInterval,tnIncrement,tdDateTime)
Local strTime As String,strOldExact As String,strOldDate As String,vReturn As Datetime
strOldExact = Set("Exact") strOldDate = Set("Date") strOldCentury = Set("Century")
Set Date BRITISH Set Exact On
tdDateTime = Cast(tdDateTime As Datetime) strTime = Substr(Transform(tdDateTime),10,8) strTime = Right(Transform(tdDateTime),11)
tcInterval = Upper(tcInterval)
Do Case Case Inlist(tcInterval,"YEAR","YY","YYYY") && Years vReturn = Cast(Transform(Gomonth(tdDateTime,tnIncrement*12))+" "+strTime As Datetime) Case Inlist(tcInterval,"MONTH","MM","M") && Months vReturn = Cast(Transform(Gomonth(tdDateTime,tnIncrement))+" "+strTime As Datetime) Case Inlist(tcInterval,"DAY","DD","D") && Days vReturn = tdDateTime + (tnIncrement * 86400) Case Inlist(tcInterval,"HOUR","HH") && Hours vReturn = tdDateTime + (tnIncrement * 3600) Case Inlist(tcInterval,"MINUTE","MI","N") && Minutes vReturn = tdDateTime + (tnIncrement * 60) Case Inlist(tcInterval,"SECOND","SS","S") && SECONDS vReturn = tdDateTime + tnIncrement Case Inlist(tcInterval,"WEEK","WW","WK") && Weeks vReturn = tdDateTime + (tnIncrement * 86400 * 7) Otherwise vReturn = tdDateTime Endcase
Set Date &strOldDate. Set Exact &strOldExact. set century &strOldCentury.
if Type("tdDateTime") Return vReturn * endfunc
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
Error Fix: The function should read as follows:
*********************** * Mirrors the SQL DateAdd() function * Written By: R.D.Crozier * From an idea in MSDN Forum * Function DateAdd(tcInterval,tnIncrement,tdDateTime)
Local strTime As String,strOldExact As String,strOldDate As String,vReturn As Datetime local dDateTime
strOldExact = Set("Exact") strOldDate = Set("Date") strOldCentury = Set("Century")
Set Date BRITISH Set Exact On
dDateTime = Cast(tdDateTime As Datetime) strTime = Substr(Transform(dDateTime),10,8) strTime = Right(Transform(dDateTime),11)
tcInterval = Upper(tcInterval)
Do Case Case Inlist(tcInterval,"YEAR","YY","YYYY") && Years vReturn = Cast(Transform(Gomonth(dDateTime,tnIncrement*12))+" "+strTime As Datetime) Case Inlist(tcInterval,"MONTH","MM","M") && Months vReturn = Cast(Transform(Gomonth(dDateTime,tnIncrement))+" "+strTime As Datetime) Case Inlist(tcInterval,"DAY","DD","D") && Days vReturn = dDateTime + (tnIncrement * 86400) Case Inlist(tcInterval,"HOUR","HH") && Hours vReturn = dDateTime + (tnIncrement * 3600) Case Inlist(tcInterval,"MINUTE","MI","N") && Minutes vReturn = dDateTime + (tnIncrement * 60) Case Inlist(tcInterval,"SECOND","SS","S") && SECONDS vReturn = dDateTime + tnIncrement Case Inlist(tcInterval,"WEEK","WW","WK") && Weeks vReturn = dDateTime + (tnIncrement * 86400 * 7) Otherwise vReturn = dDateTime Endcase
Set Date &strOldDate. Set Exact &strOldExact. set century &strOldCentury.
do case case Type("tdDateTime")="D" vReturn = Cast(vReturn as Date) * case Type("tdDateTime")="T" vReturn = Cast(vReturn as DateTime) * otherwise * endcase
Return vReturn * Endfunc
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB2BEC93... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
I was just looking at your code and noticed the bit at the end seemed to have something missing. π
SET DATE BRITISH? What's that? <g,d&rvvf>
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Dave Crozier Sent: Tuesday, May 08, 2018 9:29 AM To: profoxtech@leafe.com Subject: RE: Fun with date calculations in VFP
Error Fix: The function should read as follows:
*********************** * Mirrors the SQL DateAdd() function * Written By: R.D.Crozier * From an idea in MSDN Forum * Function DateAdd(tcInterval,tnIncrement,tdDateTime)
Local strTime As String,strOldExact As String,strOldDate As String,vReturn As Datetime local dDateTime
strOldExact = Set("Exact") strOldDate = Set("Date") strOldCentury = Set("Century")
Set Date BRITISH Set Exact On
dDateTime = Cast(tdDateTime As Datetime) strTime = Substr(Transform(dDateTime),10,8) strTime = Right(Transform(dDateTime),11)
tcInterval = Upper(tcInterval)
Do Case Case Inlist(tcInterval,"YEAR","YY","YYYY") && Years vReturn = Cast(Transform(Gomonth(dDateTime,tnIncrement*12))+" "+strTime As Datetime) Case Inlist(tcInterval,"MONTH","MM","M") && Months vReturn = Cast(Transform(Gomonth(dDateTime,tnIncrement))+" "+strTime As Datetime) Case Inlist(tcInterval,"DAY","DD","D") && Days vReturn = dDateTime + (tnIncrement * 86400) Case Inlist(tcInterval,"HOUR","HH") && Hours vReturn = dDateTime + (tnIncrement * 3600) Case Inlist(tcInterval,"MINUTE","MI","N") && Minutes vReturn = dDateTime + (tnIncrement * 60) Case Inlist(tcInterval,"SECOND","SS","S") && SECONDS vReturn = dDateTime + tnIncrement Case Inlist(tcInterval,"WEEK","WW","WK") && Weeks vReturn = dDateTime + (tnIncrement * 86400 * 7) Otherwise vReturn = dDateTime Endcase
Set Date &strOldDate. Set Exact &strOldExact. set century &strOldCentury.
do case case Type("tdDateTime")="D" vReturn = Cast(vReturn as Date) * case Type("tdDateTime")="T" vReturn = Cast(vReturn as DateTime) * otherwise * endcase
Return vReturn * Endfunc
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB2BEC93... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious. _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB2BEC93... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Report [OT] Abuse: http://leafe.com/reportAbuse/18725B8CD2D5D247873A2BAF401D4AB2BEC9369B@EX2010...
So, do you want a function that returns the second Tuesday in May or one that returns the Tuesday closest to May 8? Both would fit the specs.
Date math was one of my many VFP hobbies. There were lots of date math answers in Ask Advisor.
GOMONTH() gets you to the year you want, then you can use DOW() to figure out the day of the week that date has, then add/subtract to get to the Tuesday you're after.
On Tue, May 8, 2018 at 9:07 AM, Richard Kaye rkaye@invaluable.com wrote:
While doing my due diligence on the subject I thought Iβd toss it out here in case someone already has a function handy that will do this, thus saving me the effort of thinking too hard too early in the day. π
Hereβs the goal. I want to take a date, say today, Tuesday May 8, 2018 and figure out how to return Tuesday, May 9, 2017 or Tuesday May 10, 2016, etc. This is so I can do some year over year comparisons to transactions that occurred on the same day of the week a year ago.
TIA
--
rk
[excessive quoting removed by server]
The latter. And that was the approach I was just working through.
Thanks to both you and Dave for chiming in.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ted Roche Sent: Tuesday, May 08, 2018 9:15 AM To: profoxtech@leafe.com Subject: Re: Fun with date calculations in VFP
So, do you want a function that returns the second Tuesday in May or one that returns the Tuesday closest to May 8? Both would fit the specs.
Date math was one of my many VFP hobbies. There were lots of date math answers in Ask Advisor.
GOMONTH() gets you to the year you want, then you can use DOW() to figure out the day of the week that date has, then add/subtract to get to the Tuesday you're after.
On Tue, May 8, 2018 at 9:07 AM, Richard Kaye rkaye@invaluable.com wrote:
While doing my due diligence on the subject I thought Iβd toss it out here in case someone already has a function handy that will do this, thus saving me the effort of thinking too hard too early in the day. π
Hereβs the goal. I want to take a date, say today, Tuesday May 8, 2018 and figure out how to return Tuesday, May 9, 2017 or Tuesday May 10, 2016, etc. This is so I can do some year over year comparisons to transactions that occurred on the same day of the week a year ago.
TIA
--
rk
On Tue, May 8, 2018 at 9:14 AM, Ted Roche tedroche@gmail.com wrote:
So, do you want a function that returns the second Tuesday in May or one that returns the Tuesday closest to May 8? Both would fit the specs.
Date math was one of my many VFP hobbies. There were lots of date math answers in Ask Advisor.
GOMONTH() gets you to the year you want, then you can use DOW() to figure out the day of the week that date has, then add/subtract to get to the Tuesday you're after.
I know there's a better algorithm to do this, but this might work...
function olddate(thedate, offset) * parameters: thedate: date to start from * offset: number of years offset, positive or negative * returns: nearest date to the offset that falls on the same day of the week local thedow, thenewdow, thediff, theoffset thedow = dow(thedate) thenewdow = dow(gomonth(thedate, offset*12)) thediff = thedow - thenewdow theoffset = iff(thediff>3, 7-thediff, thediff) return gomonth(thedate, offset*12) + thediff
Or, cleaned up a bit:
FUNCTION olddate(thedate, offset) * parameters: thedate: date to start from * offset: number of years offset, positive or negative * returns: nearest date to the offset that falls on the same day of the week LOCAL thediff, theoffset thediff = DOW(thedate)-DOW(gomonth(thedate, offset*12)) theoffset = IIF(thediff>3, 7-thediff, thediff) RETURN GOMONTH(thedate, offset*12) + theoffset
Another guy that fixes his typos the 2nd time... π Thanks, Ted!
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ted Roche Sent: Tuesday, May 08, 2018 11:12 AM To: profoxtech@leafe.com Subject: Re: Fun with date calculations in VFP
Or, cleaned up a bit:
FUNCTION olddate(thedate, offset) * parameters: thedate: date to start from * offset: number of years offset, positive or negative * returns: nearest date to the offset that falls on the same day of the week LOCAL thediff, theoffset thediff = DOW(thedate)-DOW(gomonth(thedate, offset*12)) theoffset = IIF(thediff>3, 7-thediff, thediff) RETURN GOMONTH(thedate, offset*12) + theoffset
On Tue, May 8, 2018 at 11:23 AM, Richard Kaye rkaye@invaluable.com wrote:
Another guy that fixes his typos the 2nd time... π Thanks, Ted!
:)
Well, the first version ran great in GMail! The second version I actually tried running in VFP ;)
lol
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ted Roche Sent: Tuesday, May 08, 2018 11:28 AM To: profoxtech@leafe.com Subject: Re: Fun with date calculations in VFP
On Tue, May 8, 2018 at 11:23 AM, Richard Kaye rkaye@invaluable.com wrote:
Another guy that fixes his typos the 2nd time... π Thanks, Ted!
:)
Well, the first version ran great in GMail! The second version I actually tried running in VFP ;)
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CACW6n4voHTam8PGwSYwLvD5QW+eTRu9uNyGR... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious. Report [OT] Abuse: http://leafe.com/reportAbuse/CACW6n4voHTam8PGwSYwLvD5QW+eTRu9uNyGR61gh1J2EG-...
Richard, It was the Google Effect ... just like mine!!
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message----- From: ProFox profox-bounces@leafe.com On Behalf Of Richard Kaye Sent: 08 May 2018 16:53 To: profox@leafe.com Subject: RE: Fun with date calculations in VFP
lol
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ted Roche Sent: Tuesday, May 08, 2018 11:28 AM To: profoxtech@leafe.com Subject: Re: Fun with date calculations in VFP
On Tue, May 8, 2018 at 11:23 AM, Richard Kaye rkaye@invaluable.com wrote:
Another guy that fixes his typos the 2nd time... π Thanks, Ted!
:)
Well, the first version ran great in GMail! The second version I actually tried running in VFP ;)
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CACW6n4voHTam8PGwSYwLvD5QW+eTRu9uNyGR... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious. Report [OT] Abuse: http://leafe.com/reportAbuse/CACW6n4voHTam8PGwSYwLvD5QW+eTRu9uNyGR61gh1J2EG-... _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/DM5PR10MB12444639B38B2C37CAD00555D29A... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
The Google knows all, sees all, and has nothing but our best interests at heart. But the Google has no proofreading skills...
Or
DWIMNWIT
π
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Dave Crozier Sent: Tuesday, May 08, 2018 12:00 PM To: profoxtech@leafe.com Subject: RE: Fun with date calculations in VFP
Richard, It was the Google Effect ... just like mine!!
Dave Crozier Software Development Manager Flexipol Packaging Ltd. -----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ted Roche Sent: Tuesday, May 08, 2018 11:28 AM To: profoxtech@leafe.com Subject: Re: Fun with date calculations in VFP
On Tue, May 8, 2018 at 11:23 AM, Richard Kaye rkaye@invaluable.com wrote:
Another guy that fixes his typos the 2nd time... π Thanks, Ted!
:)
Well, the first version ran great in GMail! The second version I actually tried running in VFP ;)
Rofl
Op di 8 mei 2018 16:27 schreef Ted Roche tedroche@gmail.com:
On Tue, May 8, 2018 at 11:23 AM, Richard Kaye rkaye@invaluable.com wrote:
Another guy that fixes his typos the 2nd time... π Thanks, Ted!
:)
Well, the first version ran great in GMail! The second version I actually tried running in VFP ;)
[excessive quoting removed by server]
I found a millisecond approach a while back that hasn't given us any issues yet
604800000 milliseconds in a week is the fact I base the code on.
var date:Date = new Date(YYYY, MM, DD);
Datetime lastyear = date.setMilliseconds(date.milliseconds - 604800000 * 52);
On Tue, May 8, 2018 at 8:07 AM, Richard Kaye rkaye@invaluable.com wrote:
While doing my due diligence on the subject I thought Iβd toss it out here in case someone already has a function handy that will do this, thus saving me the effort of thinking too hard too early in the day. π
Hereβs the goal. I want to take a date, say today, Tuesday May 8, 2018 and figure out how to return Tuesday, May 9, 2017 or Tuesday May 10, 2016, etc. This is so I can do some year over year comparisons to transactions that occurred on the same day of the week a year ago.
TIA
--
rk
[excessive quoting removed by server]