Script to change dates

17 posts / 0 new
Last post
avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28

Thanks so much Brian. As usual your support is extremely helpful. I was trying to use DateSerial before writing to you but got wrong results, I will try your script and analyze what went wrong with my implementation. 
I will let you know the results of my tests.
Cheers, Avi

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Well I used the DateSerial here so hopefully it will work out for you.  Let me know how it goes. 

avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28

Hi Brian
I was called to help in a priority issue. It will take me few days to return to this script. I will let you know once I am back.
Thanks again for your help.

avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28

Hi Brian
I tried your code today and it worked fine. I used it to select data across (before-after) balance sheet dates and it was very useful.
Thanks a lot and have a great weekend
Avi

mkamagate
Offline
Joined: 01/31/2019 - 10:22

Greetings,
I am currently conducting a test to identify weekend transactions. My statement goes from 12/22/2018 to 01/23/2019. Is there a way to assign th right year in my equation? .My transaction date format is 12/22 ( MM/DD) on the statement. I added the year with the below equation but unfortunately it added 2019 to the decenber transactions.
field.Equation = "@Ctod(@Left( TRANS_DATE ,2) + @Right( TRANS_DATE ,2) + ""2019"", ""MMDDYYYY"")"
Regards,
Mohamed

ravisdxb
Offline
Joined: 01/13/2019 - 06:12

For the data spanning just 2 months as mentioned by you, use @If to add "2018" in case left most 2 characters equal "12", else, add "2019". 
 
field.Equation = "@Ctod(@Left(TRANS_DATE,2 )+@Right(TRANS_DATE,2)+@if(@Left(TRANS_DATE,2)==""12"",""2018"",""2019""),""MMDDYYYY"")"
 

Pages