DragonRAD Forum
May 22, 2013, 09:51:54 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Bug with time in datatime fields  (Read 1038 times)
DerekPapworth
Member
*
Posts: 46


View Profile
« on: November 22, 2010, 02:53:58 AM »

There seems to be a bug with getting at the time in datetime fields as follows ..

I have a table in a database (MS SQL 2005) with a couple of datetime columns (smalldatetime type) but I can't seem to get the time portion to display/update. One of the values for instance is "21/11/2010 15:20:00" in the database and displays as such in SQL Query etc. but when I add the field to a form it displays as "21 Nov 2010 00:00" if I set type to datetime and "00:00" if I set type to time which is what I want in this case.

Just to confirm DragonRAD is getting the right info I went to the Data / Tables section hit the Test on the Select statement and then Generate SQL and copied that into a SQL Client and it gets the correct "21/11/2010 15:20:00"

Best regards,

Derek
Logged
IanBowles
Administrator
*****
Posts: 122


View Profile
« Reply #1 on: November 22, 2010, 07:16:27 AM »

What kind of database are you using?
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #2 on: November 22, 2010, 07:38:55 AM »

Could you post the out xml which is under your host instance folder after your synch request? Something like: "C:\DragonRADHostConfig\dragonInstance\logs\yourtablename_out.xml". We will also test it on our side as well and make sure no bugs in our code. 
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #3 on: November 22, 2010, 08:34:48 AM »

Update: we tested with MS SQL 2008 as scenario below. from testing results, looks fine for us. Please do make sure your datetime type is set consistent along the way.

MS SQL Server
with timezone(EST), created a table "Testing" with field "cDateTime"  type "datetime"
create one row with cDateTime = 2010-11-22 05:00

Designer:
(1) created a new project "Testingtime" connecting to "Testing" table. The field "cDateTime" type of Testing table is set to "datetime"
(2) on update form, set cDateTime's Type property to "datetime"
(3) publish the project

BB:
with timezone(Casablanca (GMT)) loading the project, On the update form:

cDateTime initial displayed vlaue was:22 Nov 2010 10:00
changed cDateTime value to 23 Nov 2010 11:00
Synch with database,

MS SQL Server:
The value of cDatetime changed to: 2010-11-23 06:00





Logged
DerekPapworth
Member
*
Posts: 46


View Profile
« Reply #4 on: November 22, 2010, 09:06:25 AM »

Hi Yi,

Please find attached a zip file with a simple test database (MS SQL 2005) with one table with a PK field and a TestDateTime field (smalldatetime) with a couple of example values of "21/03/2010 08:30:00" and "13/07/2010 17:45:00".

I created a test project with defaults in everything except I increased the size of the column in the main grid to show full field (by the way, there doesn't seem anyway to show time/datetime in column of grid?) and also made sure the field was set to "datetime" type in the fields on the forms.

When displayed in the form they show as "21 Mar 2010 00:00" and "13 Jul 2010 00:00".

I've included in the zip the backup of the database, copy of log file, the Table1_out.xml and the project.xml

Best regards,

Derek
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #5 on: November 22, 2010, 09:43:11 AM »

Hi Derek,

From Table1_out.xml, clear saw the value of datetime field only contains y,m, d info. I will have to install a MS SQL 2005 instance (which I do not have by now) on my env to test it out. Sounds like either the Tomcat driver didnot convert the value correct or sql server did not send the right value to tomcat.

For datetime display in grid, you could config the format string of columns to what you want to display as long as it conforms to Java standard. For example: if want to display time only : you could add: HH:mm

Regards,

Yi
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #6 on: November 22, 2010, 09:46:57 AM »

Hi Derek,

In your project, TestDateTime field type of Table1 is still set as "date", this might be the reason, could you set it to datetime and try it out again?

Regards,

Yi
Logged
DerekPapworth
Member
*
Posts: 46


View Profile
« Reply #7 on: November 22, 2010, 10:04:40 AM »

Hi Yi,

Yes your right, I hadn't looked at the data table defintition area as I assumed it would pick up the correct type from the SQL metadata being smalldatetime but it was set to date .. however ..

I changed it to datetime but when I go somewhere else in the hierarchy, say to form, then back into the data table definition it now shows as text? If I change it to datetime again and immiedately save the project, close it and then open it again it's back to text?

With it set to text funnily enough that does then display correctly in the field on the form however in the column on the grid it shows as the long integer value even if I try a format mask in the column definition.

Also if I try to update the value back into the db I get an error which I'll try and explore to see more and get back to you.

Just to confirm, I should be able to set the type in the data table area for the column to datetime and it should retain that right?


Derek
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #8 on: November 22, 2010, 10:16:10 AM »

Hi Derek,

Which version of designer are you using? It was a bug there in older build and has been addressed in new release. You might need to update to newer release build through our website.

Regards,

Yi
Logged
DerekPapworth
Member
*
Posts: 46


View Profile
« Reply #9 on: November 22, 2010, 10:19:34 AM »

Hi Yi,

I'm using the DragonRADComplete.exe downloaded on the 2nd of November .. has that been updated since?

Should I re-download that or do you have incremental installers at all?

Thanks,

Derek
Logged
DerekPapworth
Member
*
Posts: 46


View Profile
« Reply #10 on: November 22, 2010, 10:29:04 AM »


f.y.i. I'm having real problems with logging in to your webite ..

this morning it wouldn't let me in and I had to reset my password with email etc., and now when I try to login it says :

The SMF username mail@derekpapworth.com has already been taken by another user.

I can log in fine to this forum using same credentials but if I log out of here (or if I stay logged in) then I get nowhere logging on on the web page.

Also, when it displays the login page you have to wait quite a number of seconds before you can type anything ..

Derek
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #11 on: November 22, 2010, 10:36:36 AM »

Hi Derek,

The newest build number should be 4812. You can check your current using version of designer through Help/About.  The new build can be download at

http://www.dragonrad.com/downloads/4812/DragonRADComplete.exe

For the forum login problem, we will take a look what is going on.

Regards,

Yi
Logged
IanBowles
Administrator
*****
Posts: 122


View Profile
« Reply #12 on: November 22, 2010, 10:37:33 AM »

Hi Derek,
Are you logging in directly on the main site, or directly into the forum? (http://dragonrad.com/smf).

Ian
Logged
DerekPapworth
Member
*
Posts: 46


View Profile
« Reply #13 on: November 22, 2010, 10:37:56 AM »

Sorted the login issue so no worries on that ..

I've just downloaded latest installer from downloads .. do I need to uninstall or can I install over the top?

Derek
Logged
YiLiu
Seregon
****
Posts: 202


View Profile
« Reply #14 on: November 22, 2010, 10:47:49 AM »

Hi Derek,

You can simply click the installer, and check the DragonRAD designer and DragonRAD host to be re-installed, then continue.... Installer will do the rest for you.

If hit any issues during installation, let us know.

Regards,

Yi
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!