Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

first day of month in command

Status
Not open for further replies.

lauriesamh

Technical User
Sep 1, 2004
119
US
I'm using CR10 and I have a command based report.
I need to change part of the command that reads

WHERE ELIG.EndDate > {?End Date}AND ELIG.BeginDate<={?Begin Date}

To find the first day of the month based on the ELIG.EndDate.

I tried using the formula in the command but it doesn't work.

Where ELIG.EndDate > {?End Date}AND
dateserial(year({ELIG.EndDate}),month({ELIG.EndDate})-1,1)<={?Begin Date}

I'm hoping it is an easy way to do this.
 
What functions are available depends upon your database--what type is it?

-LB
 
No, I mean like Oracle, SQL Server, Excel, Access, etc.

Try opening a new report with the same datasource, and then go to the field explorer->SQL expressions and check what functions are available in the functions list. You should be able to use these in your command.

-LB
 
I see them but the functions are very sparse. I've got Difference(); basic date functions such as DAYOFMONTH() and only basic Arithmatic options
 
Try using:

table.date-{fn dayofmonth(table.date)}+1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top