Skip to main content

Hello,

 

I have a date fields in a SQL database which are stored in date and datetime2 format.

When executing the Read method on the Smartobject linked to this table, it seems like it will only return the date if it can be parsed into the US Date Format.

 

i.e.

2017/08/08

will parse correctly and display however

2017/08/26

will fail to display (so anything with a day over 12 will fail to show)

 

Is there some format setting that needs changing in order for this to work correctly?

 

Thanks,

Hi Beastatron

 

What do you see if you execute the Smartobject in the Smartobject tester?

 

What date format is your browser set to?


Check the datatype of the property for your SmartObject.

I have experience that Datetime2 fields get automatically created as Memo fields, instead of the the proper DateTime.

All my new tables use the Datetime2 datatype so I must manually change this in K2 if I let Designer build my SmartObject.

 

Nathan


The SmartObject Tester returns the Date in the format 2017-02-18, which is the correct way of returning it.

The field types for all the fields are the correct types (DateTime / Date as required)

 

Surely the browser settings shouldn't determine whether the form can parse the same date correctly or not?

Otherwise that would be impossible to remove as a potential bug if we have international users.


Hello,

 

I am using the date column in SQL table and retrieving dates with smartobject and displaying them on a smartform list view. In smartform, you can write an expression to change the date format. you have mentioned that if day value is more than 12 it throws an error. I am not sure how you ar formatting the date to display, make sure that it is day segment and not a month segment. I think, you might be misplacing day with a month.

 

Please let me know if this helps.


Beastatron

 

The fact that the SMO tester is returning the dates in yyyy-mm-dd format suggests to me that the regional settings on your server are set to use this date format. 

 

There should be no issue reading the date into a control onto your form regardless of the browser settings.

 

What type of control are you reading the date into (e.g. calendar ?) and have you applied any settings to this control (e.g. date format)?


Reply