Toad World® Forums

Toad Script Runner results missing time

Hi all,

total newb here, but I did search and it looks like this format is correct. I get all of the data I need except for the time. I get the date, but I also need the time. Am I missing something here? Thanks in advance!

SELECT TIME, batch_number, P17, P18

from lmes.V_BATCHENDDATA_12GD

where cell like ‘%12GD%’ and P18 = ‘Eval’ and TIME between TO_DATE(‘07/18/2017 11:59:00 PM’ , ‘MM/DD/YYYY HH:MI:SS AM’) and TO_DATE(‘08/01/2017 11:59:59 PM’ , ‘MM/DD/YYYY HH:MI:SS AM’);

Looks like your “TIME” column is defined as a “DATE”, which is fine.

Based on the default date format you will typically only get the date portion of the date/time field. Instead, wrap the TIME column with a to_char, like this:

SELECT to_char(TIME, ‘MM/DD/YYYY HH:MI:SS AM’) my_time_as_char, batch_number, P17, P18

etc….

Best, MM

From: kodiak_kid [mailto:bounce-kodiak_kid@toadworld.com]
Sent: Saturday, August 05, 2017 12:24 PM
To: toadoracle@toadworld.com
Subject: [Toad for Oracle - Discussion Forum] Toad Script Runner results missing time

Toad Script Runner results missing time

Thread created by kodiak_kid

Hi all,

total newb here, but I did search and it looks like this format is correct. I get all of the data I need except for the time. I get the date, but I also need the time. Am I missing something here? Thanks in advance!

SELECT TIME, batch_number, P17, P18

from lmes.V_BATCHENDDATA_12GD

where cell like ‘%12GD%’ and P18 = ‘Eval’ and TIME between TO_DATE(‘07/18/2017 11:59:00 PM’ , ‘MM/DD/YYYY HH:MI:SS AM’) and TO_DATE(‘08/01/2017 11:59:59 PM’ , ‘MM/DD/YYYY HH:MI:SS AM’);

To reply, please reply-all to this email.

Stop receiving emails on this subject.
Or Unsubscribe from Toad for Oracle Forum notifications altogether.
Toad for Oracle - Discussion Forum

Flag this post as spam/abuse.

i would strongly advise you to not use reserved words as your custom names. put “A_” or noun plural but avoid to use reserved words.

Yes, you were advised to wrap the time column as to_char(TIME,‘MM/DD/YYYY HH:MI:SS’)

On Aug 5, 2017 1:24 PM, “kodiak_kid” bounce-kodiak_kid@toadworld.com wrote:

Toad Script Runner results missing time

Thread created by kodiak_kid
Hi all,

total newb here, but I did search and it looks like this format is correct. I get all of the data I need except for the time. I get the date, but I also need the time. Am I missing something here? Thanks in advance!

SELECT TIME, batch_number, P17, P18

from lmes.V_BATCHENDDATA_12GD

where cell like ‘%12GD%’ and P18 = ‘Eval’ and TIME between TO_DATE(‘07/18/2017 11:59:00 PM’ , ‘MM/DD/YYYY HH:MI:SS AM’) and TO_DATE(‘08/01/2017 11:59:59 PM’ , ‘MM/DD/YYYY HH:MI:SS AM’);

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad for Oracle Forum notifications altogether.

Toad for Oracle - Discussion Forum

Flag this post as spam/abuse.