→ 🚀Are you a Lansweeper Champion?! Join our Contributor Program Sign up here!

Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
GreenCup
Engaged Sweeper II
tblAssetCustom.WarrantyDate returns datetime

ie.
10/11/2012 00:00:00

the time is returned as zeros for all assets. How can I call the column and get just the date without the time returned to the report?
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
Use an expression like the one below.
Convert(nvarchar,tblAssetCustom.WarrantyDate,101)

View solution in original post

5 REPLIES 5
Hemoco
Lansweeper Alumni
Sample case:
Case when tblAssetCustom.Warrantydate is null then 'Unknown' when tblAssetCustom.Warrantydate < GetDate() then 'Expired' else 'In Warranty' end As [Warranty Status]
GreenCup
Engaged Sweeper II
Thanks!!

Here is another SQL query question...

I want a column, As Warranty Status, in a report that states "In Warranty" or "Expired"

This is the statement I have in mind:
If tblAssetCustom.WarrantyDate is less than Today put "Expired" As [Warranty Status]
Else put "In Warranty" As [Warranty Status]

Is there a way to accomplish this?
GreenCup
Engaged Sweeper II
GreenCup wrote:
Thanks!!

Here is another SQL query question...

I want a column, As Warranty Status, in a report that states "In Warranty" or "Expired"

This is the statement I have in mind:
If tblAssetCustom.WarrantyDate is less than Today put "Expired" As [Warranty Status]
Else put "In Warranty" As [Warranty Status]

Is there a way to accomplish this?


Managed to figure out

Case when tblAssestCustom.Warrantydate < GetDate() then 'Expired' else 'In Warranty' end As [Warranty Status]
GreenCup
Engaged Sweeper II
GreenCup wrote:


Managed to figure out

Case when tblAssestCustom.Warrantydate < GetDate() then 'Expired' else 'In Warranty' end As [Warranty Status]


This brings another issue to the table,
If the warranty date is unknown and blank in the report, it returns In Warranty to the report. Any suggestions on returning a 3rd value when the warranty date is unknown?
Hemoco
Lansweeper Alumni
Use an expression like the one below.
Convert(nvarchar,tblAssetCustom.WarrantyDate,101)

Reports & Analytics

Ask about reports you're interested in and share reports you've created. Subscribe to receive daily updates of reports shared in the Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now