cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign value to user table field of type time

Former Member
0 Kudos

Hi,

In this line of code

oUserTable.UserFields.Fields.Item("U_SBTime").Value = oDBs_Detail.GetValue("U_SBTime", i)

i am assigning value to user table field of datetime,but it is taking always 12:00 why?

here ia m updating table so, 0:00 is storing in tables

Accepted Solutions (0)

Answers (1)

Answers (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Time type in B1 only takes the hour and minits only with format: HH:MM

Date type in B1 only takes the year, month date 2009-05-26 00:00:00

That is why always 0.00 stored in DB.

You can get the exact current time the following query. like: 11:45

SELECT Left(Convert(varchar,GetDate(),8),5)

Kind Regards, Yatsea

Former Member
0 Kudos

Hi,

Thank U for u r reply,

Here iam giving time not date(eg break time ,lunch time)

i entered 12:35 , 11:45

next i want to update this timings like

this

oUserTable.UserFields.Fields.Item("U_SRTime").Value = oDBs_Detail.GetValue("U_SRTime", i)

here i am getting the problem

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Please post the contextual code for analysis.

The problem may be oDBs_Detail.GetValue("U_SRTime", i) ,

the value is not got in the right format or not retrieved at all.

Regards, Yatsea

Former Member
0 Kudos

Hi,

oDBs_Detail.GetValue("U_SRTime", i) here i am getting correct value but assing to oUserTable.UserFields.Fields.Item("U_SRTime").Value this is creating problem it is taking 0:00 value

Regards Uday