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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding to the select statement in obtainselectstatement()

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
0
0
GB
Hi guys,

I have a report with a graphical query built in the datasource editor.

the ObtainSelectStatement() has not been used at all, but I need to now use it to put the following statement in the SELECT part of the query - and then use that value as a field in the report design.
Here's the code:
Code:
next_day(To_Date('01-JAN-' || Substr("tim".CALENDAR_TIME_KEY,1,4),'DD-MON-YYYY') + (To_Number(Substr("tim".CALENDAR_TIME_KEY,10)) - 1) * 7,'Friday')

this basically changes a date of the form 2005-WEEK15 to show the friday of that week in 'normal' date format, eg. 15/04/2005

how do I go about editing the SELECT statement?

thanks in advance...

 
Hi
I think adding it as a computed field in the datasource would work better. (Less work)

If want to change the select statement you can override the ObtainSelectStatment method in the datasource:
Code:
Function ObtainSelectStatement( ) As String

	selectClause = selectClause + ", items.itemcode"

    ObtainSelectStatement = Super::ObtainSelectStatement( )
    ' Insert your code here
End Function

But I think you also have to add the field to the datarow and override the datasource BindDataRow.

Dag


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top