Datepicker also shows time

Peter Harrison shared this problem 1 year ago
Resolved

Hello,

When bringing in a datetime from SQL, I'd like to use only the date portion of the datetime in a filter. However, it seems that the time portion is always shown.


I tried changing the formating of the filter, but that did not seem to have any effect. How do I fix this?


I see other posts where the datepicker is working correctly, like this one: https://community.yellowfinbi.com/topic/what-happened-to-the-7-1-filter-date-picker-calendar

Best Answer
photo

Hi Peter,

Thanks for taking the time to join me on a call today. As a quick summary, it looks like this behavior is actually the behavior of the jTDS Driver for your SQL Server data source.

Our Development team has found that switching to the Microsoft 2005 Driver will fix this issue.

You can do this under 'Administration' > 'Admin Console' > 'Data Sources' > $NameofDataSource > 'Connection Settings' > 'Driver'.

Please give this a go and let me know if it resolves your CAST issue. I also recommend testing your content after this change to verify everything works as expected. I'll leave this open while you test this out and check back if I don't hear anything.

Thanks,

Ryan

Comments (29)

photo
1

Hi Peter,

Thanks for your email.

Can you please let me know the build you are using?

I have tested it on 7.4, 20180226, this issue has already been raised as a defect.

I will convert this question into ticket, and also in my video you will be able to see how to convert a timestamp field to date.

Please let me know if you have any questions.

Regards,

Mahesh

photo
1

Hello,


I am using 7.4 20180313


In your video, at time 1:16, you can see the issue in action, where although that filter is set as a date, the time does appear in the date picker.


So just to be clear, is that being considered a defect and it should be addressed in the future? We're currently looking to switch to 7.4 from 7.1 across all of our accounts, and this is really the only sticking point left. Otherwise really liking the UI in 7.4!

photo
1

Hi Peter,

Thanks for your reply.

I have double checked this issue and learnt that this is not actually an issue. I was using a formatter to change the format, but infact I should use the date converter and now it doesn't show me the time along with the date in the filter.

I have done a quick video and hope this helps.

Please let me know if you have any questions.

photo
1

Hi Mahe,


When I click the + that you do in your video, I do not get the same options, I only get the option to create a calculated field. So, that solution does not work for me, although I am not sure why I do not get the same options as you.

Any thoughts?

photo
1

Ah I think you were editing a view and not a report, correct?

photo
photo
1

Hi Peter,

Yes, I was editing a View and not a report.

Please let me know if you have any questions.

Regards,

Mahesh

photo
1

That did it! Thanks, this solved a months old problem! Really appreciate your help.

photo
photo
1

Thanks Peter.

I am glad this issue is now resolved.

I will mark this ticket as completed.

Please let me know if you have any questions on this ticket.

Regards,

Mahesh

photo
1

Mahe,


Although this was a good initial solution, if I create a view from freehand SQL, the option to create a date function does not exist.


I thought I would be able to change my SQL to cast or convert a datetime into a date, but when the data gets pulled in, a datetime cast or converted always appears in YF as a varchar.


About half of our views are made from freehand SQL - can you please re-open this?


Thanks

photo
photo
1

Hello Mahesh,


Any thoughts?


Peter

photo
1

Hi Peter,

Thanks for your reply. This ticket is in progress.

Can you please send me the SQL you have written to convert a DATETIME to DATE format while creating a View?

I will try the same and see if I can find a solution.

Let me know if you have any other questions.

Regards,

Mahesh

photo
1

select

cast(dd.FullDate AS Date) as "Scheduled FullDate", -- THIS LINE RIGHT HERE

wi.WorkItemKey as "Scheduled Work ID",

wicsum.MinCompletedWorkId as "MinCompleted Work ID",

wicsum.CountWIC as "Work Completed Segment Count",


-- More after this but none of it is relevant to the conversation. SQL is valid. But the 'Scheduled FullDate' Field shows up as a varchar, not a Date.

photo
photo
1

Hi Peter,

I have done a quick test using a freehand SQL with the Cast function.

Please look at this quick video and let me know if this is different to what you are seeing on your side.

Let me know if you have any questions.

Regards,

Mahesh

photo
1

Mahesh,

When i attempt to cast in the same way, we do not get the same result. I have attached a screenshot which shows the dialogue I get at 44 seconds into your video. you'll note that the Format is 'Text' instead of date.

photo
1

Hi Peter,

Thanks for screenshot.

May I know the database you are using and the data type of the date field, is it a Date type or a Timestamp?

Can you change the format from 'Text' to 'Date' format?

I will need bit more screenshot starting from the view to the report how that field is transformed from timestamp to date.

Please let me know if you have any additional questions.

Regards,

Mahesh

photo
1

Hi Mahesh,


Sorry but I am having a hard time finding the time to get all this information.


Is there a possibility to do a screen share at some scheduled meeting time, and show you what I am experiencing? I am really hoping that it is just me not using the product correctly, but it looks more and more like a bug at this point.

photo
1

This is an interesting thread. Are you using PostgreSQL? I think that you are. I'm curious to know because I imagine that when you cast as a date the output is actually a string. The easiest way to tell if you are on PostgreSQL database is to see if you can cast Try using the function to_date and specify the format. to_date(dd.FullDate, 'yyyymmdd') should resolve your issue. YellowfinBI probably sees cast using dd.FullDate::Date and CAST(dd.FullDate AS Date) as string because the output will produce the date as "Apr 20 2018".

If to_date works then this is definitely a problem with YellowfinBI not knowing how to handle PostgreSQL Original Style date data type and should be raised as a defect.

photo
1

Hi Larry,

We are using SQL.

I think I can show this in relatively short amount of time - do you have any availability today?

Thanks,

Peter

photo
1

Hi Peter,

I don't work for Yellowfin. I'm just a friendly problem solver. I was hoping that the issue was DBMS related but since you indicated that you are using SQL (MS SQL Server?) then my hands are tied. When I cast getdate() as date I get the proper formatting. Sorry.

Another thing to note is that while it appears that both Mahesh's and your default date format is set to Day/Month/Year, the textbox that displays the date range shows something else. Maybe unrelated, maybe not. There may be a glitch, perhaps checking those settings and saving them again will fix that but it was a weird observation.

4435e8c0cbb6d5b2ff4635b20bd3bec0

Lastly, I typically create a calculated field in the report, cast the datetime column as date and then place the calculated field in the filter section. I've never had an issue with this. I used to do a lot of freehand SQL views also but I realized that there's no benefit. Now I simply create a virtual table as a much better option. Doing so gives you all available features as the drag and drop method.

photo
1

Ah, my apologies. Yes, I had also considered going through and using the drag and drop editor to fix all our views. But we have well over 60 views and it would take me some time.


Further, trying to convince the rest of my company to move from 7.1 to 7.4 - not being able to format the date in a filter is a dealbreaker for upgrading. So, I'm really hoping this will get marked as a defect and fixed.


Really appreciate the help though Larry.

photo
photo
1

Hi Peter,

Thanks for your reply.

Yes, we can arrange a quick screen share. As I am in Australia timezone, I am assigning this ticket to the US team. Our team member will be in contact with you.

Please let me know if you have any concerns.

Regards,

Mahesh

photo
1

I ended up making a video showing the issue. See attached.

photo
1

Hi Peter,

I'll be taking this over since I'm in the North American office in Mountain Time zone.

I'd like to start by summarizing your current issue as I understand it: When performing a CAST to convert a datetime field to a date field, the result is being pulled in as a varchar in your Freehand SQL View.

I'm happy to attempt replicating this to raise as a Defect. Please advise the type and version of RDBMS you are creating this View upon, i.e. SQL Server 2014.

This will help to ensure I can properly replicate your issue.

Thanks,

Ryan

photo
2

Hi Peter,

Thanks for taking the time to join me on a call today. As a quick summary, it looks like this behavior is actually the behavior of the jTDS Driver for your SQL Server data source.

Our Development team has found that switching to the Microsoft 2005 Driver will fix this issue.

You can do this under 'Administration' > 'Admin Console' > 'Data Sources' > $NameofDataSource > 'Connection Settings' > 'Driver'.

Please give this a go and let me know if it resolves your CAST issue. I also recommend testing your content after this change to verify everything works as expected. I'll leave this open while you test this out and check back if I don't hear anything.

Thanks,

Ryan

photo
2

Hi Ryan,

Yes, that did seem to resolve it. I will do further testing to ensure it works as expected for other aspects of the report.

photo
2

Hi Peter,

I'm glad to hear it! I'll leave this open during your evaluation process. Looking forward to your results.

Thanks,

Ryan

photo
1

Hi Peter,

I wanted to check in and see how it's all going.

Thanks,

Ryan

photo
1

The work around seems to have addressed the problem without any other issues we can identify.

Thanks for the follow up Ryan.

photo
1

Hi Peter,


Thanks for the confirmation. I'll go ahead and mark this as Resolved as per the recommendation of changing drivers. Please don't hesitate to reach out with further questions or issues.

Thanks,

Ryan

photo