February 26, 200223 yr Hi I have this calculation that worked fine on my old computer: DateToText(Date(Month(Today);1;Year(Today))) & "..." & DateToText(Date(Month(Today) + 1;1;Year(Today)) - 1) The result is: 02/01/2002...02/28/2002 This field is called Current Month. This result is used to produce monthly report. On my new computer, the year comes first = 2002/02/01. So, my new computer cannot use the calculation because it is not a valid date. How could I get this result: 2002/02/01...2002/02/28 thank you
February 27, 200223 yr Author Vaughan There replies didn't help me out. So, I posted a new topic with more details. I still can't figure out the solution. Do you?
February 27, 200223 yr quote: Originally posted by Bikeman17: Hi I have this calculation that worked fine on my old computer: DateToText(Date(Month(Today);1;Year(Today))) & "..." & DateToText(Date(Month(Today) + 1;1;Year(Today)) - 1) The result is: 02/01/2002...02/28/2002 This field is called Current Month. This result is used to produce monthly report. On my new computer, the year comes first = 2002/02/01. So, my new computer cannot use the calculation because it is not a valid date. How could I get this result: 2002/02/01...2002/02/28 thank you Replace "Today" with "Status(CurrentDate)" -- the "Today" command is unreliable.
February 27, 200223 yr Also, go into the layout mode and format the date with a custom format to show the year first. Keep the calc in the same order; just have the layout show it in the different order.
February 27, 200223 yr Have you tried just switching it around? Like so: DateToText(Date(Year(Today); Month(Today); 1)) & "..." & DateToText(Date(Year(Today); Month(Today) + 1; 1) - 1) (Am I losing it? I know I replied to this, but it seems to have vanished! I think this has happened before, maybe I'm closing the browser window too fast.)
February 27, 200223 yr Author Fitch, the result of switching the year gives this: 02/10/0167...02/10/0167. Dan, it doesn't change anything. The issue is not Today versus Status-current date. Even if I customize the date field, the calculation is denied. The issue is entering a calculation = (current month) into a date field for a search. This field doesn't accept the calculation because the year doesn't come first. The solution is to place the year first in the calculation. How to achieve that?
February 27, 200223 yr Just a thought. you say your new computer doesnt allow the date format mm/dd/yy but yy/mm/dd. strange! Try saving a clone with no records. This will set the database to your system formats. Now try your calculation again.
February 27, 200223 yr Author Thank you for your help I solved this problem by editing my computer settings. I tried once but I failed. I finally received help from a Windows geek. Well you know, with Windows XP, I thought things would be more easier... Now, the date field uses a proper format: mm-dd-yyyy Bikeman17
February 27, 200223 yr After I posted, I had a feeling my calc would have that problem, but I bet this would have worked (now that it's too late)... parse out the date string like this: Year(Today) & "-" & Month(Today)& "-" & 1 etc.
Create an account or sign in to comment