Solved

Powerbuilder resets date and time when one of them is modified

Posted on 2007-11-28
3
575 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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
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 use and create keystrokes in Netbeans IDE 8.0 for Windows.

636 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