In SSRS how can I filter using a StartDate parameter where the format does not include AM or PM - sql

I am trying to use a Start Date parameter in a tablix filter. The problem is the incoming data is in the following format, 6/06/2013 6:00:00, and does not include AM or PM - which is causing the filter not to work properly.
Any suggestions? Thanks in advance

If you speak about AX:
You can use this function:
=Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, Fields!StartDate, "t", Parameters!AX_RenderingCulture.Value)
Fields!StartDate is your DATE field
i never use "t", if it doesn't work try "tt", it will return if your time is "AM" or "PM"

Related

WHERE Condition in the Kentico repeater

I have a list of events that are shown on "Events" page using a repeater. Each event is a page type and has a field "EventStartDateTime". I want to show only those events where the event start date is >= today. For now in the WHERE field in repeater,i am using the following condition:
(EventStartDateTime >= '{% DateTime.Now #%}') OR (EventStartDateTime = '')
But no data is visible on the page. So is it right ?
Any help will be greatly appreciated. Thanks
I checked your code and it's kinda worked for me, but I will still modify it like this:
(EventStartDateTime >= GetDATE()) OR (EventStartDateTime IS NULL)
Because second part where you compare 'Date and time' field with empty string is not correct. So in your case, you don't get any data if 'EventStartDateTime' is not populated for every item. If that is not the case, you should try remove WHERE condition and check if you get data without it.
Best regards,
Dragoljub
Your statement will work with a macro like so:
(EventStartDateTime >= '{% CurrentDateTime.ToShortDateString() %}')
Your second condition would not work because your EventStartDateTime field is (assumed) to be a DateTime object so checking for an empty string will not work. You need to check for NULL.

How to Show date in textbox which type is date in asp.net

How to Show date in textbox from database.TextBox type is "date". In asp.net
As the experts said above, this one worked for me:
((DateTime)dr["columnName"]).ToString("yyyy-MM-dd")
or
Convert.ToDateTime(dr["columnName"]).ToString("yyyy-MM-dd");
Try to re-format the date in the parentheses, it may be (yyyy-MM-dd) or (dd-MM-yyyy)
This one is working in 2023.
NOTE: I'm fetching the data from the database in a DataRow instead of DataTable, NOT because it works better, but because this is what I need.
You need to convert the value to a datetime, then convert again to string.
Something like this:
_txtCoatOrderDate.Text = ((Datetime)dt.Rows[i]["Coat_CUSTM_Date"]).ToString("dd/MM/yyyy");
Try this-
_txtCoatOrderDate.Text = Convert.ToDateTime(dt.Rows[i]["Coat_CUSTM_Date"]).ToString("dd/MM/yyyy");
i tried this its working
TextBox1.Text = ((DateTime)ds.Tables[0].Rows[0]["Coat_CUSTM_Date"]).ToString("yyyy-MM-dd");
Thanks RMH Sir

Jqgrid Datetime format sorting issue

I have a datetime format returned from the backend(dd/MM/yyyy HH:mm:ss).
JQgrid has column values as {name:'createddate',index'createddate',sorttype:'date',formatter:'date'}
but the sorting is not working properly
the result is displayed as follows:for example
06/11/2013 01:23:33
11/09/2013 02:22:34
20/09/2013 01 22:33
but the result required is:
11/09/2013 02:22:34
20/09/2013 01:22:33
06/11/2013 01:23:33
Thanks in advance.
If you use formatter:'date' then you should specify formatoptions with srcformat and newformat options. Default format of input data (srcformat) which expect formatter:'date' is ISO8601Short: "Y-m-d". You use another format so you have to specify srcformat. Format of date which uses jqGrid is PHP format (described here). So I think that the problem will be solved by adding
formatoptions: {srcformat: "d/m/Y H:i:s", newformat: "d/m/Y H:i:s"}
More better would be to use ISO-8601 format if you returns data from the server. It's locale independent format. You can use on the server side DateTime.ToString("o") or DateTime.UtcNow.ToString("o"). In the case you can change formatoptions to
formatoptions: {srcformat: "ISO8601Long", newformat: "d/m/Y H:i:s"}

Splunk date comparison

I need to be able to search for log entries with a specific start date, which has nothing to do with _time. The format is, for example, Start_Date: 08/26/2013 4:30 PM.
I need to add a condition in my search to specify the date, but not the time. I tried strptime and strftime unsuccessfully.
For example, I tried converting start date to a string (without time) and compare it to another string:
"08/26/2013"=strftime(Start_Date, "%d/%m/%Y")
This didn't work either:
"08/26/2013"=strftime(strptime(Start_Date "%d/%m/%Y %I:%M %p"), "%d/%m/%Y")
Any ideas how to solve this?
A * did the trick: Start_Date=08/26/2013*
Answer here: http://answers.splunk.com/answers/100630/splunk-date-comparison

Access SQL for sorting by date with TempVars

im trying to make a query from the use of TempVars
im Using SQL to run the query but every time i try, it return Invalid date value
this is the line that will not work
this returns error
WHERE ((([Table].[Issue Date])>=#[TempVars]![tmpDateFrom]# And ([Table].[Issue Date])>=#[TempVars]![tmpDateTo]#));
this returns fine
WHERE ((([Table].[Issue Date])>=#10/12/12# And ([Table].[Issue Date])>=#11/12/12#));
I have checked the TempVars [tmpDateFrom] and [tmpDateTo] and they out put the date value i need.
Please help
Thank you all or the help.
due to the requirement of the database #Nicarus had the right answer this is the solution for those still wondering.
WHERE ((([Table].[Issue Date])>=[TempVars]![tmpDateFrom] And ([Table].[Issue Date])>=[TempVars]![tmpDateTo]));