Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Annemie19
Helper II
Helper II

POwe Bi Report Builder - Date/time Conversion failed

Hi There, 

 

I'm starting to use Power Bi report builder. When I try to view my report I keep on getting the error below.

 

Annemie19_0-1604920175351.png

 

My query is shown below. As soon as I replace the @ProjEndDate and @ProjStartDate with '2020-03-31', '2020-04-15' respectively the report works. 

 

SELECT
d.[DealID]
,d.[DealNumber]
,d.[PreviousDealNo]
,d.[NextDealNo]
,d.[PayMethod]
,d.[PayBranch]
,d.[PayAccountNumber]
,d.[NoOfShares]
,d.[NominalAmount]
,CONVERT( date,d.[IssueDate],103) As Issue_Date
,CONVERT( date,d.[RedemptionDate],103) As RedemptionDate
,d.[SecurityDescription]
,d.[CertifiecNos]
,d.[CertificateHeldWhere]
,d.[TypeOfClass]
,d.[CaptureDate]
,CONVERT( date,d.[RiskDate],103) As RiskDate
,CONVERT( date,d.[CreditDate],103) As CreditDate
,CONVERT( date,d.[ManagementDate],103) As ManagementDate
,CONVERT( date,d.[ReleaseDate],103) As ReleaseDate
,CONVERT( date,d.[ProjectionDate],103) As ProjectionDate
,d.[UserID]
,d.[NetCapitalChanges]
,d.[CurrentNominalAmount]
,d.[PayBranchCode]
,d.[PayAccountHolder]
,d.[DealType]
,d.[BankName]
,d.[LastInterestType]
,s.Name AS SubsidiaryName
,s.RegNo AS [Subsidiary RegNo]
,cp.Name AS CounterpartyName
,cp.CTitle1
,cp.CName1
,cp.CSurname1
,cp.CSurname2
,cp.PAddress1
,cp.PAddress2
,cp.PAddress3
,cp.PPostCode
,CONVERT( date,ProjStartDate,103) AS ProjStartDate
,CONVERT( date,ProjEndDate,103) AS ProjEndDate
,ProjectedAmount

FROM [InfoMart_FinancialProducts].[dbo].[VwPrefSharesDeal] d

JOIN [dbo].[VwPrefSharesSubsidiary] s on s.SubsidiaryHashKey = d.SubsidiaryHashKey
JOIN [dbo].[VwPrefSharesCounterparty] cp on cp.CounterpartyHashKey = d.CounterpartyHashKey
JOIN [dbo].[VwPrefSharesCashProjection] c on c.DealHashKey = d.DealHashKey

WHERE DealID =@DealID
AND CONVERT( date,ProjStartDate,103) = @ProjStartDate
AND CONVERT( date,ProjEndDate,103)= @ProjEndDate

 

Can someone please assist with this error?

 

Kind Regards,

Annemie

1 ACCEPTED SOLUTION

@amitchandak  - I found the problem. My parameter data type was set to text and not date/time

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Annemie19 , any reason you are converting dates to text? bring them directly

@amitchandak  - I found the problem. My parameter data type was set to text and not date/time

@amitchandak  - Are you referring to the CONVERT( date,... it just added this before because I thought that it might be the problem. But even without the CONVERT( date,.. it still gives the same error. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.