If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL Input Data and Retrieve?(Oracle)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-26-04, 01:16
omega omega is offline
Registered User
 
Join Date: May 2004
Posts: 12
Question SQL Input Data and Retrieve?(Oracle)

Hi there I need to create a script to highlighting any bookings recorded for a given date by entering the date from the keyboard.

So far I've come up with the code below but I'm still unsure on how to get it work , any suggestions?

SELECT Name, Phonenumber, Date_of_Arrival
TO_CHAR('Date_of_Arrival, Date) "Input any Date:"
From booking
Order by Date_of_Arrival;

thx.
Reply With Quote
  #2 (permalink)  
Old 05-26-04, 01:49
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
SELECT Name, Phonenumber, Date_of_Arrival
FROM booking
WHERE Date_of_Arrival = '&Input_any_date'
ORDER BY Date_of_Arrival;

Parameter "Input_any_date" should be entered in default date format. If you'd like to change it, change it to (for example)
WHERE Date_of_Arrival = TO_DATE('&Input_any_date', 'dd.mm.yyyy.')

By the way, "ORDER BY date_of_arrival" doesn't have much sense here as this query returns data for just one date.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On