I'm trying to get the age of my user in crystal report using parameter and current date.
This is my formula for the crystal report.
INT ((CurrentDate - {?txtbdate}) / 365.25)
For example: the date in {?txtbdate} is 1996-07-29 and today
is 2018-10-25.
The age must be 22.
When I execute it, a popup message appear saying "A number is required here."
This is just a blind guest, but you must first convert the data before doing the math,
For ex. (INT (CurrentDate) - INT ({?txtbdate})) / 365.25
each value must be Identified as integer before subtracting
The Right way of doing it:
you can use the DateDiff function on the
ex. DateDiff("yyyy", CurrentDate, {?txtbdate})
Related
I have a report that displays monthly and ytd amounts. I use start and enddate parameters that change according to the user. For example for startdate 4/1/2007 and enddate 2/28/2008
1. I need to display title as Monthly budget 2/1/2008 to 2/28/2008
2. I need to display title for YTD as YTD 4/1/2007 to 2/28/2008
I tried = Parameter!EndDate.value but it throws error
It looks like you may have missed a letter in your expression. It should be:
=Parameters!EndDate.Value
In the expression editor you can double click on the parameter name and it will insert it into the expression for you.
To get the full description that you mentioned, you'll need to use a combination of functions. One useful one to look at is DateAdd to add days and months to the specified date. Another one is FormatDateTime which allows you to use the standard "ShortDate" format.
If you run into further trouble, I would recommend posting a new question with the variations of code that you tried along with the specific error messages that you received.
You could try setting the Expression for a text box to:
="Monthly Budget " & FORMAT(Paramters!StartDate.Value, "MM/dd/yyyy") & " to " & "FORMAT(Paramters!EndDate.Value, "MM/dd/yyyy")
This will give you:
Monthly Budget 02/01/2008 to 02/28/2008
It is the same for your second requirement, just change the wording.
Currently working with Blue Prism and I want my exception report to only bring back exceptions from the last 24 hours.
I have tried using 'Today()' in the 'Report From Dt' and 'Report To Dt' which works fine however there is a chance my process will ru into the next day and thus makes this not viable.
Is there a calculation for the past 24 hours?
The action "Get Reports Data" from BO "Work Queues" requires an input in form of DateTime variable.
The Today() function outputs a variable of the type Date, which is then cast into the datetime variable. When BluePrism casts a date to datetime, then it sets a time to a midnight. The answer for your problem is that you need to supply the action "Get Reports Data" with the DateTime variable that will be a datetime of now - 24hours!
Example solution to that could be:
Now()-MakeTimeSpan(0, 24, 0, 0)
I am trying to get a date from its integer components: I have day, month and year as variables (that can change, I don't want to hard code them), and I want to reunite them in a date variable.
For example, something like that;
myDay: 15
myMonth: 4
myYear: 2016
`date$(myYear,myMonth,myDay) --> should return 2016.4.15 (formatted as a date).
Any way to do that?
Thank you
q)d:3
q)m:8
q)y:2016
q)"D"$"." sv string (y;m;d)
2016.08.03
See cast vs tok - need to use different arguments depending on if what you're casting from is a string or not
Being new to Crystal could someone point me in the correct direction.
I have a field, in an SQL view which is datetime.
I have converted this to time only using
time ({rep_Sterling_YEARLYSHEETCOUNT.StartDateAndTime})
I now want to use this in a further formula to determine if the operation occurred on the day or the night shift
if {#Time Convert} > #06:00:00# and {#Time Convert} < #18:00:00#
Then 'Days'
Else 'Nights'
However I am told 'A Date-time is required here.
What have I got wrong?
When you enclose in betweed # it will be treated as datetime and hence the error.
So change like this:
if {#Time Convert} > Ctime("06:00:00") and
{#Time Convert} < Ctime("18:00:00")
Then 'Days'
Else 'Nights'
I have been trying unsuccessfully to find a way to filter out records from a report.
I have a field titled time_period in a view that returns a date in the "MM/YYYY" format.
I have two parameters titled startMonth and endMonth which are in "MM/DD/YYYY".
Somehow I need to be able to make sure that the date_grouping field value is between the two parameters.
Here's what I have so far...
{location_total_kpi_view.time_period} >=
Date(Month({?startMonth}) + Year({?startMonth})) and
{location_total_kpi_view.time_period} <=
Date(Month({?endMonth}) + Year({?endMonth}))
It excludes all records. Any suggestions?
Try converting them both to yyyy/MM format and then into dates to make sure that the comparisons are equal, like this:
Date(ToText({location_total_kpi_view.time_period}, "yyyy/MM")) >=
Date(ToText({?startMonth}, "yyyy/MM")) and
Date(ToText({location_total_kpi_view.time_period}, "yyyy/MM")) <=
Date(ToText({?endMonth}, "yyyy/MM")) and