Solved

Powerbuilder resets date and time when one of them is modified

Posted on 2007-11-28
3
545 Views
Last Modified: 2013-12-26
I have a date column in my datawindow which i separated into two fields using edit mask one has mask of 'mm/dd/yy' and the other 'hh:mm'.
but when i modify the date field then the time field becomes 00:00
and when i modify the timefield then the date field becomes 01/01/1900

so i can never place an approrpiate date/time because they keep canceling eachother out.

i tried manipulating the 'data' value within itemchanged event since that's where i noticed it'd rest the time.
but that didn't work. i tried using replace, and setitem, then accepttext() and that didn't work i still get time = 00:00.

please point me to the right direction.

0
Comment
Question by:badtz7229
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
ced888 earned 500 total points
ID: 20372876
You should make two columns one for date and one for time. You can achieve this by modifying your select

example:

SELECT dt_actual_date,
              dt_actual_date    date_portion,
              dt_actual_date    time_portion,
FROM yourtable

Make sure to use an alias on the second and third datetime columns. The date_portion should be masked only for the date and the time should be masked only for the time.

This way you will have two columns one for the date one for the time. When the date or the time portion is changed, you setitem dt_actual_date based on the value of the date_portion and the time_portion. By the way, the date_portion and the time_portion is not included in the updatable columns You can also hide the dt_actual_date column since it is only used to setitem and to getitem.

We have been doing this for all of our payroll applications which has a separate date and time entry but is basically stored in one DATETIME column.

Thanks.
0
 

Author Closing Comment

by:badtz7229
ID: 31411503
Thank you so much. That totally resolved my issue.
0
 

Author Comment

by:badtz7229
ID: 20397329
I just had one quick question about your solution , you stated
"By the way, the date_portion and the time_portion is not included in the updatable columns "
Did you mean that the date_portion and the time_portion should NOT be selected as updatable columns, in the Update Proporties ?
In my case, i did not select them .
Please clarify, thanks.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Debugging a PHP Web Application 2 104
Intellij adding new line in xml 3 71
eclipse formatting 6 87
Embarcadero C++ Builder XE10.1 Berlin red arrow Indicator 2 34
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question