1. Frank Monfort
  2. PowerServer Mobile (Obsolete)
  3. Monday, 11 January 2021 13:03 PM UTC
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?
Attachments (1)
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 11 January 2021 13:50 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 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

 

Comment
  1. Miguel Leeuwe
  2. Monday, 11 January 2021 15:26 PM UTC
That's why I wrote also "Also, maybe you are using a different dateformat in your windows when compared to the database settings on the server.".

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.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 11 January 2021 15:28 PM UTC
which database and what database profile are you using? Is there any indication of a date / datetime format in the dbparm?
  1. Helpful
  1. Andrew Barnes
  2. Monday, 11 January 2021 19:47 PM UTC
A couple of things to look at. When you initialize it to Today(), how are you doing that? Are you doing a SetItem passing it Today() or are you passing it DateTime(Today()). My thought process is that if passing it a Date datatype vs. a DateTime datatype might be causing an issue.



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.
  1. Helpful
There are no comments made yet.
Frank Monfort Accepted Answer Pending Moderation
  1. Monday, 11 January 2021 16:04 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 2
I am using SQL Server and I configure the profile in the powerserver tollkit. I do not put parameters
Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Monday, 11 January 2021 17:20 PM UTC
I don't have Powerserver installed (nor SqlServer) at the moment, but there'll be a place somewhere where you specify more database parameters I think. Maybe with some sql server tool?

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.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 11 January 2021 17:24 PM UTC
What language settings for date / datetime do you have on the powerserver server?
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 11 January 2021 17:39 PM UTC
Also, as said before, look at the "format" of the column. The 'editmask" only "plays" when you're "editing" the column.

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.
  1. Helpful
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Monday, 11 January 2021 17:32 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 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,

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 11 January 2021 17:51 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 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

Comment
  1. Frank Monfort
  2. 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
  1. Helpful
  1. Frank Monfort
  2. Tuesday, 12 January 2021 08:36 AM UTC
It already happened in the previous version and they said that in 2019 R2 it would be solved, but it still gives the same problem. And it is something basic, being able to record a DateTime field with the Update () of a datawindow
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 12 January 2021 11:58 AM UTC
Wow, that would have been useful information to give us when you posted the initial question.

:)
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 12 January 2021 00:13 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 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

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.