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

Sending a datetime parameter...Help

Status
Not open for further replies.

davefm1

Programmer
Apr 18, 2001
78
US
Hi;
First I create enter a date field in a asp (yymmdd).
Then covent it to a date time field for the crystal report parameter field.

time_str = ",12,00,01)"
temp_array = Split(dd250_date,"/")
temp_date = temp_array(2) & "," & temp_array(0) & "," & temp_array(1)

This results in a date format of
DateTime(2002,6,25,12,00,01)

Then I added this to my call string for this parameter

& "&prompt7=" & CR_date


When crystal viewer comes up it prompts me for the same exact date field in the same format. Does any one have a clue to what i'm doing wrong.

I'm in the dark on this one.

Thanks
Dave
 
You need to end up with double quotes aroung the DateTime(2002,6,25,12,00,01)

So your formula would look like (excuse the extra spaces they are there so you can see the breaks between the quotation marks)

& "&prompt7=" & ' " ' & CR_date & ' " '

Lisa
 
HI Lisa;

The double quote's are build in to the field along with DateTime

time_str = ",12,00,01)"
temp_date = temp_array(2) & "," & temp_array(0) & "," & temp_array(1)

CR_date = "DateTime(" & temp_date &" "& time_str

This produce's the folowing format
"DateTime(2002,5,25 ,12,00,01)"
This is what that cystal report is still prompting me for

This is how i'm senting my URL
& "&prompt6=" & contr_number & "&prompt7=" & CR_date & "&prompt8=" & cont_value

view source displays prompts below
webSource0.AddParameter "prompt6", "004751"
webSource0.AddParameter "prompt7", "DateTime(2002,04,05 ,12,00,01)"
webSource0.AddParameter "prompt8", "96"

Still in the dark

Thanks
Dave
 
Could you show us what the actual URL you are creating looks like (preferably from the viewer when it is opened).

Lisa
 
Dave,

Passing DateTimes to URLs was my bane all last week, so I know how frustrating this can be for you.

Firstly, switch your 'prompt' references to 'promptex'. Initially, thought that the two commands behaved the same, but something Lisa said last week in a CE thread prompted me to evaluate the two commands, and it seemed that 'prompt' was far less reliable than 'promptex'.

After the switch, the two points you should consider are passing the DateTime value as a string, (which you're already doing) and encoding the relevant characters in the DateTime field.

Try altering your conversion formula so that it looks like this:

time_str := "%2C12%2C00%2C01)"
temp_date := temp_array(2) & "%2C" & temp_array(0) & "%2C" & temp_array(1)

CR_date = "DateTime(" & temp_date &" "& time_str

The idea being that you replace all the ',' with the hex translation; '%2C'. Commas don't pass into URLs. You discover if this is your problem when the URL address window populates with your passed string, but stops abruptly at "Date(2002 , ending with a Page Not Found error. (This only occurs with promptex, I found. Prompt instead prompts you to re-enter the value, or assumes the default.)

All the best, Dave,

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top