Topic Options
#56212 - 01/31/18 06:19 PM GridView 9.2B (160504) with DSN
MarlonMF Offline
Adagio Guru

Registered: 06/05/07
Posts: 126
Loc: Los Angeles, CA
Hi,

I'm using GridView to get data from SQL database. It works great, except I found out today that the datetime that it is reading shows correctly when viewing. But when you use that information in any calculation, anything past noon will round it up to next day.

Example:

Datetime of "2018-01-29 12:20 PM", if I use a calculated field and put this data in there, it will show "2018-01-30 00:00 AM"

For datetime of "2018-01-29 11:59 AM", if I put this in calculated field, it will show as "2018-01-29 00:00 AM"

Is there a way around for it not to round up?

Marlon

Top
#56218 - 02/01/18 09:05 AM Re: GridView 9.2B (160504) with DSN [Re: MarlonMF]
MarlonMF Offline
Adagio Guru

Registered: 06/05/07
Posts: 126
Loc: Los Angeles, CA
I found a work around.

You'll need two windows grids, one for reading and viewing the datetime, the other will getlinkvalue the datetime. This way, it does not round up and from there I can use it in another calculated field without rounding up.

Anyway, can you folks do a patch or make it a part of improvement on future release if you have not done so on GridView 9.3.

Marlon

Top
#56219 - 02/01/18 09:44 AM Re: GridView 9.2B (160504) with DSN [Re: MarlonMF]
Michael Mulrooney Offline
Adagio Virtuoso

Registered: 02/07/02
Posts: 839
Loc: Vancouver, BC
Glad you came up with a work around, in order to better define the issue please post :

1) Date of ADS32.DLL in the Softrak\System folder

2) Specific "Type" of SQL date column from below
[DateTime1 - smalldatetime]
[DateTime2- time(7)]
[DateTime3- date]
[DateTime4- datetime]
[DateTime5- datetime2]
[Datetime6- datetimeoffset]


3) Format used in the Gridview column definition

Another work around on the SQL side would be to insert a column that converted the datetime column to and INTEGER and use that in Gridview

This is the first report of this behavior and was NOT addressed in GV 9.3A



Edited by Michael Mulrooney (02/01/18 11:06 AM)
Edit Reason: Added SQL date type

Top
#56220 - 02/01/18 10:16 AM Re: GridView 9.2B (160504) with DSN [Re: MarlonMF]
Retired_Guy Offline
Adagio Master

Registered: 03/16/99
Posts: 10504
Loc: Canada
Hi Marlon,

I'm glad you found a workaround.

I think that SQL stores the time as a fractional portion of the number. Try taking the INT() of the date and see if that results in a different value.
_________________________
Andrew Bates

Top
#56221 - 02/01/18 10:42 AM Re: GridView 9.2B (160504) with DSN [Re: Michael Mulrooney]
MarlonMF Offline
Adagio Guru

Registered: 06/05/07
Posts: 126
Loc: Los Angeles, CA
Michael M,

1. Ads32.dll - 08/04/2017
2. The SQL Column data type is "datetime"
3. Format used in GridView
a. MM/DD/YYY
b. MM/DD/YY HH:MM

Thanks for the suggestion, but the SQL database is from another 3rd party application. So, no can't change.

Marlon

Top
#56222 - 02/01/18 10:45 AM Re: GridView 9.2B (160504) with DSN [Re: Retired_Guy]
MarlonMF Offline
Adagio Guru

Registered: 06/05/07
Posts: 126
Loc: Los Angeles, CA
Hello Andrew,

Yes, you're right. I tried the Int() function, but the result is the same.

As soon as you put the datetime column in a calculated field without any function, it rounds up to a whole number.

Marlon

Top
#56225 - 02/01/18 11:10 AM Re: GridView 9.2B (160504) with DSN [Re: MarlonMF]
Michael Mulrooney Offline
Adagio Virtuoso

Registered: 02/07/02
Posts: 839
Loc: Vancouver, BC
Thanks for the info: we will check this out for a future release.

Top
#56234 - 02/01/18 01:23 PM Re: GridView 9.2B (160504) with DSN [Re: Michael Mulrooney]
Michael Mulrooney Offline
Adagio Virtuoso

Registered: 02/07/02
Posts: 839
Loc: Vancouver, BC
I created a SQL Table with datetime4 as datetime with 2 records:

2018-01-02 11:59:00.000
2018-01-02 12:59:00.000

Using Gridview 9.3A and a DSN pointing to the SQL database I get:

02.01.2018
02.01.2018

in a calculated column I am able to duplicate your issue

02.01.2018
03.01.2018 <== error

Something happening in the formula engine. Will let you know when a "fix" is available.

Top
#59490 - 12/12/18 10:01 AM Re: GridView 9.2B (160504) with DSN [Re: Michael Mulrooney]
Michael Mulrooney Offline
Adagio Virtuoso

Registered: 02/07/02
Posts: 839
Loc: Vancouver, BC
Hi Marlon,
The issue of Datetime being rounded up when used in a calculation has been resolved in Gridview 9.3B (2018-11-07)

Top


Moderator:  Christa_Meissner 
Who's Online
0 registered (), 69 Guests and 0 Spiders online.
Key: Admin, Global Mod, Mod
Forum Stats
1865 Members
5 Forums
14467 Topics
70661 Posts

Max Online: 432 @ 01/20/25 10:17 PM
April
Su M Tu W Th F Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30