If the time is showing then the data type must be DateTime - to get rid of the time just cast it as a Date i.e.
CAST(LicenseExpiry AS DATE)
Here's an example of what I mean:
declare @demo DateTime = GetDate()
select @demo
select CAST(@demo AS date)
For checking a date + 45 days you should really use the DATEADD function rather than just + 45 and definitely don't do any conversions on date format when comparing.
WHERE CAST(LicenseExpiry AS date) <= dateadd(DD, 45, getdate())
Talking of converting dates, you shouldn't really be converting the Dates before returning them to the calling process. Displaying dates in a particular format should be left to the presentation layer.
It (conversion of dates) can really slow down processes and it means the calling process may have to convert the varchar back to a date to use it!
I followed the link from @NotPoliticallyCorrect's comment -
Convert from gregorian to hijri date[
^] and it seems that SQL Server doesn't handle hijiri dates particularly well.
A technique I have used in the past when using non-gregorian dates is to generate a "calendar" table that stays permanently on my database as a reference.
The basic set up is
CREATE TABLE [dbo].[DateMapper](
[GregDate] [date] NOT NULL,
[MappedDate] [date] NULL,
[Comments] [nvarchar](124) NULL
) ON [PRIMARY]
;WITH Q AS
(
SELECT CAST('2010-JAN-01' AS DATE) as datum
UNION ALL
SELECT DATEADD(dd, 1, datum) FROM Q
WHERE DATEADD(dd, 1, datum) < DATEADD(yy, 10, GETDATE())
)
INSERT INTO DateMapper
SELECT datum, CAST(null AS date), null as [Comments]
FROM Q
OPTION (MAXRECURSION 0
Then you run whatever the conversion is against the dates in the table - only once. Obviously remember to schedule updates to the table as required in the future.
To use the table you join against the DateMapper table to check which ever dates you want (in the WHERE clause). E.g. Your select query would become (taking into account all of the comments above)
SELECT [Purchesdateen], [Purchesdate], [Selleren], [Seller], [Notes], [MoreInformation], [Total], [Inurancevalue], [OtherCharge], [ShippingCharge], [PurchesValue], [SpareKeys], InsuranceExpiryen,InsuranceExpiry, [InsuranceCompany], LicenseExpiryen , LicenseExpiry, [Orignalen], [Orignal], [Statusen], [Status], [Locationen], [Location], [Userren], [Userr], [Owneren],
[Owner], [Colouren], [CustomerDuties], [Contractno],[Startcontract], [Startcontracten] , [Image], [Colour], [Yearen], [Year], [Typeen], [Type], [Platenoen], [Plateno], [No]
FROM [ALL_VECH] AV
INNER JOIN DateMapper DM ON DM.GregDate = CAST(AV.LicenseExpiry AS date)
WHERE DM.MappedDate <= dateadd(DD, 45, getdate())
[Edit]
Having done all of that I re-read the question and I think I misunderstood it. You may find this snippet more useful (but I will leave the above advice too):
declare @demo DateTime = GetDate()
select @demo
select CAST(@demo AS date)
SELECT CONVERT(varchar, CAST(@demo AS date), 131)