
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2014 03:46 AM
I have a report that I created using a date conversion on to display the date in an ODBC standard format YYYY-MM-DD. The sql command used is: Convert(nvarchar(10),tblAssetCustom.PurchaseDate,120) As [Purchase Date]. This works. This report was also created about v5152.
I have since upgraded us to v5166
I am trying to create a new report for disposal dates using Custom Field 5 as a Date selection, with the same YYYY-MM-DD format, using teh same command: Convert(nvarchar(10),tblAssetCustom1.Custom5,120) As [Disposal Date], and all I get is MM/DD/YYYY. I have tried using the entire list of known ODBC date styles, and none of them are displaying properly.
I have since upgraded us to v5166
I am trying to create a new report for disposal dates using Custom Field 5 as a Date selection, with the same YYYY-MM-DD format, using teh same command: Convert(nvarchar(10),tblAssetCustom1.Custom5,120) As [Disposal Date], and all I get is MM/DD/YYYY. I have tried using the entire list of known ODBC date styles, and none of them are displaying properly.
Solved! Go to Solution.
Labels:
- Labels:
-
Archive
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2014 03:01 PM
Custom fields remain text fields within the Lansweeper database, regardless of what you set their display type to. This is why your conversion is failing, because you're not converting DateTime values. Convert your values to DateTime first, like so:
Convert(nvarchar(10),Convert(datetime,tblAssetCustom.Custom5),120)
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2014 07:15 PM
Thank you!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2014 03:01 PM
Custom fields remain text fields within the Lansweeper database, regardless of what you set their display type to. This is why your conversion is failing, because you're not converting DateTime values. Convert your values to DateTime first, like so:
Convert(nvarchar(10),Convert(datetime,tblAssetCustom.Custom5),120)
