Skip to Content
0
Former Member
Nov 01, 2012 at 12:17 AM

Create Date in Crystal Reports Command

624 Views

Hello:

I needed to combine fields from different tables (making a command table) in order to get the results that I need in Crystal Reports. I now need to modify it to get additional information and I am having difficulty "creating" a date in the command sql - odbc connection.

SELECT GLAccountBalances.SKGLAccount, Year(GLAccountBalances.BalanceDate), GLAccountBalances.BalanceDate,GLAccountBalances.Balance,GLInfo.CurrentYear
FROM GLAccountBalances,GLInfo
Where Month(GLAccountBalances.BalanceDate)=12 or Year(GLAccountBalances.BalanceDate)=GLInfo.CurrentYear

Union

Select GLBudgetDetail.SKGLAccount,GLBudgetDetail.FiscalYear,CDate(GLBudgetDetail.FiscalYear,12,31) as tyear,GLBudgetDetail.FullYearAmount, GLInfo.CurrentYear
From GLBudgetDetail,GLInfo
Where GLBudgetDetail.FiscalYear=GLInfo.CurrentYear;

The part in red is where I get a scalar error. Does anyone know what the correct syntax is to accomplish this?

Thanks in advance