Solved

Powerbuilder resets date and time when one of them is modified

Posted on 2007-11-28
3
564 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dangers of teaching programming 10 140
Java eclipse error 2 78
Delphi : could not find program, '...exe' 2 244
Embarcadero C++ Builder XE10.1 Berlin red arrow Indicator 2 100
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

752 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