I have been working on what seemed to a simple date comparison to hide an object until the proper date arrives.
I have trying different variations and each seem NOT to work. I am trying to suppress an object in Crystal Reports until, let's say, August 1 2018. After the specified date, have it display.
CurrentDate >= #8/1/2018#
ToText(CurrentDate) >= "8/1/2018"
The reasoning I have to change labels soon and rather manually go back in later (I have a ton of labels) figured I'd do what seemed a simple date comparison and switch.
Thanks,
Gary
Figured it out;
if (CurrentDate) >= #8/1/2018# AND (#TrueFalse Field) = false then false
if (CurrentDate) >= #8/1/2018# AND (#TrueFalse Field) = true then true
else true
Worked like a charm.
Thanks,
Gary
Related
I am using Tableau Server version 10.4.3
I have a dimension rTime which has string value. the entries in rTime is of like this
May 10, 2019 8:59:56.303 PM UTC
I want to check whether the rTime is today or not. I cannot use DateParse since my server doesn't have this functionality.
I created a calculated field CheckrTime with below content :
STR(LEFT(SPLIT([rTime],':',1),LEN(SPLIT([rTime],':',1))-2))
When I am dragging CheckrTime into workspace area, the output is coming in below format which is what I wanted :
May 10, 2019
When I am checking ISDATE("May 10, 2019") (a normal string), it is outputting TRUE as expected but when I am checking ISDATE(CheckrTime) it is outputting FALSE . Why?
The reason I am checking above thing is I am looking to use DATEDIFF function of tableau in this way:
DATEDIFF('day', DATE(CheckrTime), TODAY()) == 0
NOTE
If someone is wondering ,I have taken care of the level of granularity.
If you have a better solution then the one I am following, please do tell me.
This is working for me. I would expect May 10 <> May 16 (today) and therefore return false. However, when I change your example to today's date it does in fact come back as true.
You could also try this formula for the date LEFT([rTime],FINDNTH([rTime],' ',3)). It is slightly less complicated but will give you the same answer.
Calculated field (date type) depends the locale used which defines date format. Are you able to use Date function?
In Tableau website there is a example using english locale
For string 06May2017
DATE (LEFT([Original Date], 2) + "/" + MID([Original Date],3,3) + "/" + RIGHT([Original Date],4))
Above mentioned highligts / character between digits which is depending on locale
Im having a problem with a datepicker on vb6, but this jus happen on certain dates, for example 31/01/2017, but with another dates it works fine.
I appreciate the help
This almost certainly has to do with how you are setting the date in the control.
For instance if the control's value is ANY month that does not have 31 days then you will get that error. Trying to set the control to 31/02/2017 would cause an error 380.
There are two approaches you can take to fix this.
Reverse the order you set the date components.
dtFecha.Year = Year(fcsAux.Fields("xf3ch4"))
dtFecha.Month = Month(fcsAux.Fields("xf3ch4"))
dtFecha.Day = Day(fcsAux.Fields("xf3ch4"))
Set the Value property instead of the date components. dtFecha.Value = "31/02/2017"
dtFecha.Value = rcsAux.Fields("xf3ch4").Value
The first approach ensures the month is always appropriate for the day. The second approach sets the entire value at one shot and should be a valid date.
I'm not getting the selected date, but the emulator's system date. Tried publishing and installing on actual Samsung S6, same it's showing system date not selected date. Is there something wrong with my code below?
function Page1_TextButton1_OnPressed(e)
{
SMF.UI.showDatePicker({onSelect:DoSomething});
}
function DoSomething(e)
{
alert(e.date);
}
Your code has some missing but that is not the actual problem. You are probably trying to select a date from past. There is a problem about that and will be fixed with the next release.
By the way I suggest you to use datePicker as in the documents (http://docs.smartface.io/html/M_SMF_UI_showDatePicker.htm).
You should add mask, minDate and maxDate values, etc.
But as I said, although you add these values to your project, it will not work now. The problem will be fixed with the next release.
I have a DateTime property.
I want to check if a date is equal to the date in my property and it has to be done purely in the url query parameters available in OData v4.
This doesn't work :(
GET ~/odata/foo$filter=date(myProperty) eq date(1980-01-01)
Yes I can use greater then or equal but that's is already working as intended. It's equal and not equal that's the problem.
From ABNF rules, Date value is a value with format:
dateValue = year "-" month "-" day
So, I think you shouldn't add date prefix. That's:
GET ~/odata/foo$filter=date(myProperty) eq 1980-01-01
Here's some test cases provided by ODataTeam:
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L169-L171
and
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L208-L212
Besides, there's a simple tutorial you can refer to:
http://odata.github.io/WebApi/#04-04-date-and-timeofday-support
Thanks. Hope it can help.
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