|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
I have listed my code below. All I want to do is show all records for YESTERDAY.
I know how to show todays date. But how can I automatically calculate yesterdays date? This statement 'am.local_receiving_time < SYSDATE' is what I'm currently using and it's just not what I want. Cheers select am.message_group,' ', DECODE(am.severity, 0, 'Unchanged', 1, 'Unknown', 2, 'Normal', 4, 'Warning', 8, 'Critical', 16, 'Minor', 32, 'Major') as severity,' ', nn.node_name, substr(TO_CHAR(am.local_receiving_time,'DD-MON-YYYY HH24:MI:SS'),1,30),' ', mt.text_part from opc_act_messages am, opc_message_groups mg, opc_msg_text mt, opc_node_groups ng, opc_nodes_in_group ngig, opc_node_names nn where am.message_group <> 'OpC' and mg.name <> 'Misc' and am.local_receiving_time < SYSDATE and (am.severity = 1 or am.severity = 4 or am.severity = 8 or am.severity = 16 or am.severity = 32) and am.message_number = mt.message_number and am.node_id = ngig.node_id and am.node_id = nn.node_id and ngig.node_group_id = ng.node_group_id and ng.node_group_name = 'hp_ux' group by am.message_group,am.severity,nn.node_name,am.local_receiving_time,mt.text_part order by 1,2,3,4,5; quit; |
|
#2
|
|||
|
|||
|
I found the solution. I put this statement in my where clause so that only records from YESTERDAY are displayed.
and substr(TO_CHAR(am.local_receiving_time,'DD-MON-YYYY'),1,30) = substr(TO_CHAR(SYSDATE-1,'DD-MON-YYYY'),1,30) Quote:
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > NEWBIE needs help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|