Copy link to clipboard
Copied
Hi all,
Im working with my first cfchart that is using a field with a date. My problem is that is has the time included and its not needed for my chart, Is there any way to insert just a date into my field and leaved the time out. Any help, opinions or suggestions are appreciated.
Thanks,
Brian
Copy link to clipboard
Copied
Hi Brutas,
First thing to check is to see that the field type for the date field is set to "date"
and not "datetime".
You can also handle date format/structure at time of insertion too.
Leonard B
Copy link to clipboard
Copied
Check your db documentation. There may be a way to strip the time portion out.
Copy link to clipboard
Copied
You can do it in the database, or you can edit the query data before sending it to CFCHART. What database are you using? If SQL Server 2008, then you have the "date" datatype, but before 2008 it's just datetime. Look at doc for the SQL Server CONVERT function - there are a zillion different date, time and datetime formats that you can have it convert the data to, so that's probably the easiest way - just put it in the SELECT statement with an "AS justTheDate" and then use queryname.justTheDate in the CFCHART call.
If you cannot do it in the database, then you're going to need to do a CFLOOP over the resultset, and do a CFSET to change the datetime to just the date, before handing it off to CFCHART.
-reed