Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Argument #1 of DateDiff is out of range Post Reply Post New Topic
Author Message
gizmosilly
Newbie
Newbie
Avatar

Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 26
Quote gizmosilly Replybullet Topic: Argument #1 of DateDiff is out of range
    Posted: 12 Jul 2011 at 11:27am

I am trying to get the time difference from one process to the next when I put in my formula it is giving me an out of range error message below is my formula

datediff('MM,DD,YYYY,HH,MM,SS',
(datetime(year(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          month(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Day(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})))),
(datetime(year(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          month(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Day(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})))))
 
This is the date appears
5/5/2011 10:57:21AM
Please let me know what I am doing wrong
Thanks
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jul 2011 at 11:33am
datediff('MM,DD,YYYY,HH,MM,SS',
You have to select one value from the red list. Do youwant to see the differnce in month or day or years etc.
IP IP Logged
gizmosilly
Newbie
Newbie
Avatar

Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 26
Quote gizmosilly Replybullet Posted: 13 Jul 2011 at 3:36am
I selected HH from the list and that did not work so then I selected MM that still did not work so then I added the Hours Minutes and Seconds to my formula and that still does not work it still says that argument 1 is out of range (what I am looking to compare is the amount of time in hours or minutes that it took to go from one process to another) 
 
datediff ('HH',
(Datetime(year(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Month(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Day(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Hour(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Minute(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Second(Minimum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})))),
(Datetime(year(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Month(maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Day(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Hour(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Minute(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})),
          Second(Maximum ({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE})))))
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jul 2011 at 4:13am

sorry,, many of your values were not valid and I did ot point that out...

h is for hours and n is for minutes.
 
I do not know what your 'process' is that youa re checking time differences but I would assume it is in a group sop your group level formula would look something like this (for minutes)...
 
datediff('n', minimum({@Date Time}, {Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE}), maximum{Billing_Cycle_Process_Tag_File.DocumentOrderInvoiceE}))


Edited by DBlank - 13 Jul 2011 at 4:13am
IP IP Logged
gizmosilly
Newbie
Newbie
Avatar

Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 26
Quote gizmosilly Replybullet Posted: 13 Jul 2011 at 8:19am
That worked thanks for everything!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.014 seconds.