Getting date in format 20 Mar 2018 (Tue) - reporting-services

How can I display date as dd MMM yyyy (ddd) in SSRS?
Thanks!

You can right click the textbox and select Text Box Properties...
Then select Number and Custom. After that, enter the date format.

Related

Grouping by date and time values from a DateTime value in SSRS in 24 hour format

I have a Stored Procedure which will be returning the columns Date( in yyyy/mm/DD HH:mm:ss format),Names and Data. When I'm making the Date part of Date(in MM/dd/yyyy format as parent row group ,Time part of Date as child row group and Name as column group and Data as the value in the matrix, I'm getting the time values consistently from 1:00 ,1:30,2:00,2:30 .. to 11:30 and it is displaying 23:59,12:00, 00:30 and jumping to the other Date group instead of staring from 00:30,01:00 ...to 11:30 and continuing as 12:00,12:30,13:00 to 23:59. The SP results will contain the time for one of the names from 00:30,01;00,01:30 to 23:30 and 23:59 and the other name will have times as 01:00,02:00 to 23:00 and 23:59.
I'm getting the values correctly up to only 11:30 starting from 01:00. I need the time values to be 00:30,01:00,01:30...12:00,12:30...23:00,23:59
Note:(since grouping is involved and one of the name's time does not equals other, 0 will be displayed in those cells - It is also working fine but only up to time 11:00 and it is displaying 23:59,12:00,00:30 and jumping to the other Date group
Can someone please help on this?
Thanks in advance.
It sounds like you are grouping for time in a 12-hour format but not including the period (AM/PM) which is tt in the formatting.
hh is for a 12 hour so you would need to add the tt
=FORMAT(Fields!DATE_FIELD, "hh:mm tt"
HH is for a 12 hour so you would not need to add the tt
=FORMAT(Fields!DATE_FIELD, "HH:mm"
The issue seems to be the type of grouping. I have used date for one of the groups and string type for other group. Now I have changed both to string and it is working fine.

How to convert varchar date (Mon, 02 Jan 2017 15:46:23 GMT) to date formated data in mysql

In my database table one field upload_datetime is there and it is having a value like Mon, 02 Jan 2017 15:46:23 GMT. I want to get a formatted date like 2017-01-02 15:46:23. Please somebody help me with getting it in select query.
I tried with STR_TO_DATE,CAST but I am not getting any output. It's returning NULL.
You can use
DATE_FORMAT(NOW(),'%d %b %Y %T:%f')
The NOW() returns the present datetime and you can replace it with other datetime that you want
In my database table one field upload_datetime is there and it is having a value like Mon, 02 Jan 2017 15:46:23 GMT.
This statement might be a bit misleading, because we don't need to be particularly concerned with how a datetime is stored internally. Your exact question is to how to format that datetime in a certain way.
The DATE_FORMAT() function is one way to go here. It accepts as input a time column, and a format mask, and returns a formatted string.
SELECT DATE_FORMAT(upload_datetime, '%Y-%m-%d %H:%i:%s') AS upload_formatted
FROM yourTable
I got the answer. after doing some R&D i found the way.Thanks all for your comment.
SELECT date_format(STR_TO_DATE(concat(substr(datetime_uploaded ,6,2),"-",substr(datetime_uploaded ,9,3),"-",substr(datetime_uploaded ,13,4)),'%d-%M-%Y'),'%Y-%M')
FROM OpsMetrics

Why chart.js display only one day?

In MySQL I have data of date like this
Day-Month-Year H D time
12-01-2016 23:00
13-01-2016 00:00
Chart.js code of display date:
type: 'time',
time: {
displayFormats: {
hour: 'DD-MM-YYYY h:mm a'
Chart.js stops on 12-01-16 23:00
Next date is 13-01-16 00:00
Why Chart.js can't show this 13-01-16 00:00 no mater if I change it to 13-01-16 00:10
After 13-01-16 00:00 i have 10 hours to show on chart :/
I whant to display date like: DD-MM-YYY
In SQL date is 12-01-2016 23:00 [MM-DD-YYYY]
but Chart.js display : 01-12-2016 Like I whant
I intentionally insert date in MYSQL like 12-01-2016 23:00 [MM-DD-YYYY]
Chart.js
enter image description here
second .png excample is correct :)
Help

SSRS date from previous year but with the same weekday name selected

I am trying to get last year's date but with the same week day as the one selected. Meaning that if the user selects Dec 5th 2013 which is a Thursday, the formula would select Dec 6th 2012 which is also a Thursday. Any help would be greatly appreciated.
Find/Replace "Today()" with the name of the field or parameter.
=Switch (
WeekDay(Today())-WeekDay(DateAdd("d",-365,Today())) = 0, DateAdd("d",-365,Today()),
WeekDay(Today()) > WeekDay(DateAdd("d",-365,Today())), DateAdd("d",(-365)+ABS(WeekDay(Today())-WeekDay(DateAdd("d",-365,Today()))),Today()),
WeekDay(Today()) < WeekDay(DateAdd("d",-365,Today())), DateAdd("d",(-365)-ABS(WeekDay(Today())-WeekDay(DateAdd("d",-365,Today()))),Today())
)

Any way to get string out of a string that has no definite length?

I have this problem in SQL Server that I'm trying to figure out. I have this string saved in the database which has the download location and download date of a file so it can have as much length, sample here.
downloadedFile = c:/Programs and Features/Public/MyFiles/Myfile Mar 23 12:55 PM
or it can be like this:
downloadedFile = C:/Programs and Feature/Public/MyFiles/FileTypes/MOV/MyFile Mar 23 1:25 PM
Can I get the full DATETIME even if it changes format? First example above was from MM DD HH:MM format Second was MM DD H:MM format, as you can see, hour came from two digits to one, screwing up my chance of using substring. This string is in the middle of a string, so if, even one character adds to the result set, a problem might occur parsing it to datetime. Any ideas?
you could use CHARINDEX() Function
declare #downloadedFile varchar(500);
set #downloadedFile =
'c:/Programs and Features/Public/MyFiles/Myfile Mar 23 12:55 PM'
select substring(#downloadedFile,
CHARINDEX('Myfile ',#downloadedFile)+7,LEN(#downloadedFile))
Result:
Mar 23 12:55 PM
.
set #downloadedFile =
'C:/Programs and Feature/Public/MyFiles/FileTypes/MOV/MyFile Mar 23 1:25 PM';
select substring(#downloadedFile,
CHARINDEX('Myfile ',#downloadedFile)+7,LEN(#downloadedFile))
result:
Mar 23 1:25 PM
Use an analog function to split string.
use the "space" as delimiter. And the last 4 indices of the array is your date/time.
Maybe this could help you
http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/4126a010-6885-4eb0-b79c-c798c90edb85