BookmarkSubscribeRSS Feed
databobjr
Calcite | Level 5
Hi,

I use Oracle database. The date data type in the oracle table is date with include the time. such as 1/29/2011 12:34:23.

When I tried to create a filter and prompt for it, SAS took it as a timestamp data type and it took in the date and time for the prompt. how do I eliminate the time part of the date string and use the data without the time.

Also, there is no option for me to change the timestamp data type to date when I created the prompt.

Thanks,
Bob Message was edited by: databobjr
3 REPLIES 3
Madelyn_SAS
SAS Super FREQ
One workaround is to create a new data item in the information map and convert the Oracle date to a SAS date using the datepart() function. Then use the new data item in the prompt.
ShaneGibson_OptimalBI
Fluorite | Level 6
Be carefull though as if you use a datepart then SAS can;t pass the query to Oracle and will be forced to query the entire Oracle table into a temporary SAS dataset.

Will work but would be slow on large tables.

I havent test 9.2/4.3 to see if it is better at passing this query to Oracle though.
Peter_C
Rhodochrosite | Level 12
> Hi,
>
> I use Oracle database. The date data type in the
> oracle table is date with include the time. such as
> 1/29/2011 12:34:23.
>
> When I tried to create a filter and prompt for it,
> SAS took it as a timestamp data type and it took in
> the date and time for the prompt. how do I eliminate
> the time part of the date string and use the data
> without the time.
>

can you make or use the prompt as a range
between &date 0:0:0 and &date 24:0:0

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 768 views
  • 0 likes
  • 4 in conversation