From: Michael Malone[SMTP:mmalone@A.CRL.COM]
We are in the process of making our reports comply with our company’s Y2K guidelines. Right now, our BO reports’ prompts accept either a 2 or a 4-digit year in the date prompts. Is it possible to force the user to enter a 4-digit year? (We are using SQL Server 6.5).
Well, we run Oracle, so the answer needs not be useful for you, but… If you use @Prompt function for prompt, then you can specify type for user’s response.
If you specify it as D for date - everything will work OK for you. On the other hand, if you generate prompt from objects in universe, it uses @Variable function,
which always treates user’s response as text. So, you should use ToDate function on your prompt.
Unfortunately, I don’t know of a better way to add this function than openin SQL window,
adding to_date and marking “Do not generate SQL before running” or crerating a special
prompt object with Designer… Anyone happens to know a way to have:
“Object equal to function(prompt)”
in Data Provider Editor? Just curious, I do have a Designer module fortunately…
A second question is can we force the date formats in a UserResponse formula to display 4-digit years if the user enters only a 2-digit year. I have tried the ToDate() function with a format string of “mm/dd/yyyy” on a date like 8/1/98, but the result is still 8/1/98.
To force a specific display of date, use FormatDate(Date,“FormatString”) - if your date is of type date.
If you have your date as string, simply use FormatDate(ToDate(“YourDateString”,“FormatString1”),“FormatString2”), where FormatString1 specifies how to convert user’s response to Date format and FormatString2 - how to
display your date… Easy, isn’t it?
Ryszard Mikke
–==> Hiroshima’45 Tschernobyl’86 Windows’95 <==-- R.Mikke@pl.vwfsag.de
Listserv Archives (BOB member since 2002-06-25)