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!

Showing date prompts in cells without timestamp 1

Status
Not open for further replies.

ba543

MIS
Jan 15, 2004
34
0
0
US
I have a report that is created off of date prompts. Unfortunately those date prompts are a date and a timestamp. I want to show just the date prompt. The dates are prompted as Begin Date and End date I want to be able to show both. Below is an example of what I have on the report.
1/24/2004 12:00 AM - 1/27/2004 12:00 AM

my goal is to get the report to show
1/24/2004 - 1/27/2004

I have created a variable using the ToDate function but it has not worked, everytime I bring it into the report I get
# error. Below is my variable statment.

=ToDate(UserResponse ("Query 1 with AIS-MQR1" , "Type Begin Date") ,"mm-dd-yyyy")
I'm not sure whats causing the error, but I would really appreciate any help possible,
Thanks in advance
 
Your data is already a date, so using the ToDate() function will not work. You will need the FormatDate() function instead.
Use the help on the relevant functions and you will get the picture...

T. Blom
Information analyst
tbl@shimano-eu.com
 
=FormatDate(UserResponse ("Query 1 with AIS-MQR1" , "Type Begin Date") ,"mm/dd/yyyy")

This is the statement I put in and I'm getting and incorrect data type error. It highlights the comma right before the string format. Not sure why it won't allow this variable to work.
 
Hmmm,

I was a bit too hasty on this one. The userresponse function may return everything as a string possibly (?)

The following seems to work in anycase:

variable 1 : <Response> =UserResponse("Y" ,"Z")

variable 2: <Response_left>

= If (Length(<Response>)=18) Then Left(<Response> ,9) Else If (Length(<Response>)=19) Then Left(<Response> ,10) Else If (Length(<Response>)=17) Then Left(<Response> ,8) Else ""

This returns the datepart only in any case ....

T. Blom
Information analyst
tbl@shimano-eu.com
 
So far that I know that worked because I didn't get any errors the only problem is that when I try to drag the second variable on to the report I get a blank cell. I am new with using variables in business objects so I'm not sure if I have to have a cell already setup or should I just be able to drag the variable right into the report header. I dragged the first variable right in (to test) and it showed what I've been using before for the begin date and end date.
Below is what I did just want to make sure I understand you correctly.

Prompt =UserResponse ("Query 1 with AIS-MQR1" , "Type Begin Date")

Prompt Left = If (Length(<Prompt>)=18) Then Left(<Prompt> ,9) Else If (Length(<Prompt>)=19) Then Left(<Prompt> ,10) Else If (Length(<Prompt>)=17) Then Left(<Prompt> ,8) Else ""

 
Just create a stand-alone cell, go to menu Data --> Variables, select the proper variable and push on the displace button.
BO allows for dragging and dropping extensively, but I am an OLDSKOOL BO man and stick to using menus, slice and dice and the formulabar.... :)

T. Blom
Information analyst
tbl@shimano-eu.com
 
I do not have a displace button to press when I go into the menu. Is there any other button that I can push or use.
Sorry for the bother thanks for all the help, this has been giving me trouble since I started it.
 
Got it working, the only thing you didn't account for was the AM so the length was actually 21 not 19, but it was a wonderful help, would have never thought of that, thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top