recreate timestamp

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

recreate timestamp

Post by crisg0112 »

Hi,

I have a date attribute and a timestamp attribute BUT the format is HH:mm

Based on this two attributes I want to create a new timestamp attribute

Is there a function in Aware that will allow me to do this?
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: recreate timestamp

Post by hpl123 »

Cris,
Take a look at this post to see if you can get it to work:
http://www.awareim.com/forum/viewtopic. ... =date_part
Henrik (V8 Developer Ed. - Windows)
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: recreate timestamp

Post by crisg0112 »

hpl123 wrote:Cris,
Take a look at this post to see if you can get it to work:
http://www.awareim.com/forum/viewtopic. ... =date_part
Hi,

Thanks for replying. Yeah saw that post already but the problem is that the time is a constant time.

I tried to do the following but Aware is coming up with an error "exception while saving the object null".

TIMESTAMP(DAY_OF_MONTH(MyBO.Work_Date),MONTH(MyBO.Work_Date),MyBO(Timesheet.Work_Date),HOUR(MyBO.TimeFrom),MINUTE(MyBO.TimeFrom))

Also, why is the HOUR function expecting a date parameter which I find a bit weird?

maybe a TIME_PART function on the next build? Since we already have a DATE_PART that extracts only the date component of a timestamp attribute
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: recreate timestamp

Post by hpl123 »

Cris,
Try going over how you use the function. What you wrote for example don´t look right:
TIMESTAMP(DAY_OF_MONTH(MyBO.Work_Date),MONTH(MyBO.Work_Date),MyBO(Timesheet.Work_Date),HOUR(MyBO.TimeFrom),MINUTE(MyBO.TimeFrom))

and also you don´t have YEAR as part of the function?

I have used this function before to do similar things but took me quite a few tries to get it working (syntax has to be correct etc.)
Henrik (V8 Developer Ed. - Windows)
BobK
Posts: 545
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: recreate timestamp

Post by BobK »

Try something like this:

BO.MyTimeStamp=AS_TIMESTAMP(AS_STRING(BO.TheDate, 'MM/dd/yy')+AS_STRING(BO.TheTime,'HH:mm'), 'MM/dd/yyHH:mm')
Bob
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: recreate timestamp

Post by crisg0112 »

hpl123 wrote:Cris,
Try going over how you use the function. What you wrote for example don´t look right:
TIMESTAMP(DAY_OF_MONTH(MyBO.Work_Date),MONTH(MyBO.Work_Date),MyBO(Timesheet.Work_Date),HOUR(MyBO.TimeFrom),MINUTE(MyBO.TimeFrom))

and also you don´t have YEAR as part of the function?

I have used this function before to do similar things but took me quite a few tries to get it working (syntax has to be correct etc.)
thanks for the advice, will do
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
Post Reply