SSRS - How to AVG then format a number - reporting-services

I'm trying to get the average handle time per call to display as HH:MM:SS.
What I can't seem to figure out is how to take the AVG(Field) and make it HH:MM:SS. I can either A) avg and get the a decimal number which represents seconds or format total seconds for all calls in HH:MM:SS. but can't seem to marry the two. I'm sure it's simple but can't find anything on here that works.
This was one of my attempts that didn't work. "=Format(Avg(Fields!AHT.Value), 'HH:MM:SS')"
Any help would be greatly appreciated!

You should be able to do something like ...
=DATEADD(DateInterval.Second, AVG(Fields!AHT.Value), Today())
then format this textbox as Time in the textbox properties, under 'Number' or use the format code T
This gives this result..
All the expression does is take Today() which is only the date (therefore the time is 00:00:00) and then add the average number of seconds to it. So the actual result is today's date plus the time we want. Then format the textbox as time only, to hide the date portion.

Related

How can I change a custom date into numbers in Google spreadsheet?

I want to do a vlookup/sumif based on dates
How can I do it? I saw from a source I have to first change it into numbers
Somehow I cannot do it with formulas like value/Datevalue, I can only convert it by changing its format.
Spreadsheet image
The vlookup() and sumif() functions work fine with dates and date time values.
With vlookup(), you can get an exact match of a date time value by setting the is_sorted parameter to false. To match the first value that is less than or equal to a date time, make sure that the data range is sorted, and set that parameter to true.
With sumif(), if you need to remove the time component from a date time value to match dates to date times, use datevalue().
See this answer for an explanation of how dates and times work in spreadsheets.

SSRS removes leading zeros from dates

so whenever I get a date back from my query I get something like 05/02/2017 HH:MM:SS. However, SSRS will display it as 5/2/2017 HH:MM:SS. I know I can adjust the type of the data cell to display a date value ( with leading zeros) but those options do not display the time.
Any solution to this?
Thank you
Change the Format property of your date field to the below:
dd/MM/yyyy hh:mm:ss
This will display your date with leading zeros and also include the time.

Convert Date to a number in mysql (Like how a date converts in Excel)

What is the correct function to use when i want to convert a date to a number. Like when you enter a date in excel for example (now()) and then it will show the date but when you click on the number format it will show you a number.
I tried to use Unix timestamp but its not exactly the output i was looking for.
The date i entered is today's date
=now()
and the output i was hoping to get is
42146
what's the correct function to get this result in mysql?
Thank you
Microsoft Excel bases date serial numbers from Jan 1, 1904 or from Jan 1, 1900 (depends on the setting in the workbook.)
To generate a date "serial number" similar to what Excel uses, just calculate the number of days between NOW() (or whatever date you want to convert), and the base date. For example:
SELECT DATEDIFF(NOW(),'1900-01-01') AS excel_serial_date_1900
(You might need to add 1 or subtract 1 to get the exact same value that Excel uses, I've not tested that.) If your Excel workbook is using the 1904 based serial date, use '1904-01-01' as the base date in the expression.
Note: the DATEDIFF function returns integer number of days, operates only on the "date" portion, and doesn't include any fraction of a day.
Reference: https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_datediff

How can I get Mysql's DATE_FORMAT() to display hours over 24?

I'm using DATE_FORMAT(time, '%H:%i') to get the time nicely formatted in HH:MM in a query, my problem however is that if the time goes over 24 hours it adds a day and the hour count will start again from zero, this way I can't display times like 40:00.
I have looked at the documentation here http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
But there doesn't seem to be an obvious way to display hours over 24, the only choices seem to be 00..23 and 01..12, I'd be happy with something like 01..99 instead, is there a way to do this?
Try using TIME_FORMAT() instead of DATE_FORMAT(). TIME_FORMAT()'s documentation says that
If the time value contains an hour part that is greater than 23, the %H and %k hour format specifiers produce a value larger than the usual range of 0..23. The other hour format specifiers produce the hour value modulo 12

dd/mm/yyyy date format in SSRS

i'm trying to specify dd/mm/yyyy dateformat for date/time parameter in SSRS 2008 R2.
My computers datetime format is mm-dd-yyyy.
My requirement is, i want to show date format at dd/mm/yyyy irrespective of the system/server date format.
I've already tried CDate(Format(Today,"dd/mm/yyyy")) which didn't work. one very strange thing i observed is, it shows dd/mm/yyyy format only for dates on or before 12-MM-yyyy, and 13 onwards it gives error: Conversion from string '25-04-2014' to type Date is not valid. (Possibly it is trying to map 25(daypart) with MM-dd-yyyy (month part)) which is out of range of total months i.e. 12)
my research on internet says it is a bug in BIDS 2008.
What do i do to display date as dd/mm/yyyy ??
I don't have enough reputation to comment, but I did notice that you failed to put "()" after "Today". If I'm not mistaken you must put Today() for that function to work. Also, you might want to try putting CDate Around the Today() function. You shouldn't need it, but it's worth a shot. Also, for some odd reason, in my experience, you must capitalize MM for format to work correctly.
Like #Aditaya said, it should be =format(Today(),"dd/MM/yyyy")
The expression I usually use is:
=FormatDateTime(Fields!Date.Value, DateFormat.ShortDate)
However, this may be region specific.
Rather than writing an expression to do the formatting, you can also use the Textbox Format Property. But first you need to make sure that the data is in a date format. So use the CDate function on your column like this:
=CDate(Fields!Date.Value)
Then in the textbox properties go to the Number tab. Select Date for the category. Then you can select whichever format you want or use a Custom format. This will change how the column displays when you run the report.