Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateAdd function to add 15 minutes

Status
Not open for further replies.

crac74

Technical User
Sep 13, 2004
46
CH
Hi,

I'm working on CR 8.5 and I'd like to create a field which adds 15 minutes to my database time field.
The field {iAgentPerformanceStat.Time} returns time by intervals (04:00, 04:15, 04:30,...)

My new field is @Time+15
I wrote:

DateAdd ("N", 15,{iAgentPerformanceStat.Time})

but it doesn't work (I'm a beginner...)
 
Do you have a date field? Then you could do the following:

time(dateadd("n",15,datetime({table.date},{iAgentPerformanceStat.Time})))

-LB
 
my date field is {iAgentPerformanceStat.TimeStamp}

but when I try to save the this formula there is an error :
{iAgentPerformanceStat.Time} is not seen as an hour...

 
If you right click on {iAgentPerformanceStat.Time} and choose "Browse field data" what datatype does it say at the top? And I guess you are saying that {iAgentPerformanceStat.TimeStamp} is a separate date field? Please confirm its datatype also.

-LB
 
{iAgentPerformanceStat.Time}
type = string
length = 5
data = 00:00, 00:15,...

{iAgentPerformanceStat.TimeStamp}
type = date
data = 08/07/2004, ...

they are 2 separate tables of the database

thanks for your help.
 
Try:

time(dateadd("n",15,datetime({iAgentPerformanceStat.TimeStamp},
time({iAgentPerformanceStat.Time}))))

-LB
 
yes it works !!!
just a detail, I would like to have only hours and minutes like in the field "time" (hh:mm)
I have hh:mm:ss



 
Right click on the formula->format->field->datetime->select "14:01" or "2:01 pm".

-LB
 
I have the same database.

How would I display an hourly total instead of a 15 interval total?
 
Create a formula {@datetime}:

datetime({iAgentPerformanceStat.TimeStamp},
time({iAgentPerformanceStat.Time}))

Then insert a group on this and choose "print on change of hour". Then you can insert summaries on your data at the hourly group level.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top