Discussions

Ask a Question
Back to All

Why is the SQL so complicated?

Is there anyway to make the SQL statements smarter? Or for once, just let the users put in custom SQL.

SELECT Count([vBoCsContactBasic].[ID]) AS [Sum_Total] FROM  vBoCsContactBasic WHERE ([vBoCsContactBasic].[IsCompany] = 0 AND [vBoCsContactBasic].[IsMember] = 1 AND [vBoCsContactBasic].[PaidThrough] <= CAST(cast(convert(varchar(10), getdate(), 112) as datetime) as DateTime2) AND [vBoCsContactBasic].[Status] = 'A')

Why are you converting a DateTime to VarChar, Casting it to a DateTime Then Casting it to a DateTime2?

Contact us
Copyright © Advanced Solutions International, All rights reserved.