I have a field in a datetime type datawindow with mask: dd-mm-yyyy hh: mm and when the update of the datawindow is done it gives the error of the image.
Why is this happening?
- You are here:
- Home
- Q&A
- Q&A
- PowerServer Mobile (Obsolete)
- Error datetime in datawindow
- Frank Monfort
- PowerServer Mobile (Obsolete)
- Monday, 11 January 2021 13:03 PM UTC
- Monday, 11 January 2021 13:50 PM UTC
- PowerServer Mobile (Obsolete)
- # 1
Because there's no way implicit conversion can make a valid date(time) from you invalid date in string format:
2021-00-08 ...
00 is not a valid month.
Also, maybe you are using a different dateformat in your windows when compared to the database settings on the server.
regards
- Monday, 11 January 2021 16:04 PM UTC
- PowerServer Mobile (Obsolete)
- # 2
- Miguel Leeuwe
- Monday, 11 January 2021 17:20 PM UTC
Also on powerserver you might not get thousands of milliseconds precision on datetimes, but again, I'm not sure of that. Maybe someone else can respond or if not, I'll try to install myself.
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Monday, 11 January 2021 17:24 PM UTC
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Monday, 11 January 2021 17:39 PM UTC
I do see a "space" in your edit format "dd-mm-yyyy hh: mm", between the ": " and "mm". Not sure if that could be of any meaning.
-
Helpful Loading... Helpful 0
- Monday, 11 January 2021 17:32 PM UTC
- PowerServer Mobile (Obsolete)
- # 3
Hi Frank,
Besides what Miguel has mentioned, you might also want to make sure that you are not using a datetime2 data type when you actually only need a datetime data type.
Regards,
- Monday, 11 January 2021 17:51 PM UTC
- PowerServer Mobile (Obsolete)
- # 4
Hi Frank;
Can you tell us ...
- PowerBuilder version & build
- PowerServer version & build
- SQL Server version & build
- What type of mobile device are you using
- What type of Mobile O/S are you using (version & build)
- AWS version & build is being used on your device.
Regards ... Chris
- Frank Monfort
- Monday, 11 January 2021 21:14 PM UTC
It is simply a datawindow with a DateTime field with the mask dd-mm-yyyy hh: mm. Something that anyone must have encountered with this problem.
When I do the dw_1.Update () is when I get that error
-
Helpful Loading... Helpful 0
- Frank Monfort
- Tuesday, 12 January 2021 08:36 AM UTC
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Tuesday, 12 January 2021 11:58 AM UTC
:)
-
Helpful Loading... Helpful 0
- Tuesday, 12 January 2021 00:13 AM UTC
- PowerServer Mobile (Obsolete)
- # 5
Hi Frank,
Thanks for reporting this problem! We reproduced it on our end. If everything goes well, this issue will be fixed in the PowerServer 2020 EBF which is planned to be released within the first quarter of 2021.
At this moment, please temporarily work around this issue by changing the language to English on mobile device.
Regards,
ZhaoKai
- Page :
- 1
However, you are not allowed to reply to this question.
First of all, check the type of the field and the "format" not just the edit mask of the column. Maybe there's something wrong there.
Something else to look at would be the do a GetItemDateTime on the column after you initialize it. Either display in a message box or step through and examine in the debugger. My thought process is that it might point you in a direction is you know where the month is getting set to 00, when the column is set or when PB is creating the SQL update statement.