Scripting with dates

Listers,

A plea for help -

I have entered the wonderful world of scripting and I’m having a problem with which I desperately need some help. The problem I’m attempting to solve with scripting is as follows - I have one query which returns one date value by calling an Oracle function (written in-house). I want to use the date value in a condition on subsequent queries within the same document. Basically I need the script to simply return the value from the first data provider in the document.
I have achieved this using the following script, ‘script1’ -

Sub main
dim result as String
result = ActiveDocument.DataProviders.Item(1).Columns.Item(1).Item(1) Application.Variables.Item(“number”).Value = result End Sub

I’ve set up the script as an object, ‘start of day’, which is defined as @script(‘number’,‘A’,‘script1’)

I then, in the queries I want to access the value returned by the script, set up a condition in the query panel as follows - date_period Equal to start of day.

This works successfully when I convert both the value returned by the first query and the ‘date_period’ object using Oracle’s to_char function to ensure they have the same format. My problem is that I cannot, for performance reasons, use the to_char function on the ‘date_period’ object as this is an indexed column and using to_char will render the index obsolete.
Can someone advise me on date formats please? What I need to know is what format is a date returned in from an Oracle database when no format is applied in Business Objects?
I asked Business Objects about this and they informed me that it was determined by the InputDateFormat parameter in the Ociv7.sbo file, which is ‘DD-MM-YYYY HH:MM:SS’ in my case. However when I set the format to that, in my first query, I get no data returned. Any help, advice anyone can offer on this would be most greatly appreciated.

Many Thanks,
Ailie Forgie


Listserv Archives (BOB member since 2002-06-25)