Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Anniversary Dates Between Two Periods

User_OK580Aug 30 2021

Hi all,

I am having issues with a query to show anniversaries between two dates. I have the below query to show the anniversary date:
SELECT
add_months(start_date,(EXTRACT(YEAR FROM TO_DATE('&TO_DATE','DD/MM/YYYY')) - EXTRACT(YEAR FROM start_date))*12) as anniversary_date
FROM Table_A

WHERE
add_months(start_date,(EXTRACT(YEAR FROM TO_DATE('31/03/2022','DD/MM/YYYY')) - EXTRACT(YEAR FROM start_date))*12) BETWEEN TO_DATE('01/04/2021','DD/MM/YYY') AND TO_DATE('31/03/2022','DD/MM/YYYY')
I would like to run the report between two dates but when i add the above statement in the WHERE clause it is only showing results for the year 2022 and not the From Date (2021).

Any help is appreciated!

TIA

Comments

kuljeet singh -
if using exp give full path in FILE parameter
incase of expdp create directory with full path where you want to store dmp.
875255
im using exp. how to give parameters
Mahir M. Quluzade
Answer
If your dmp file in C:\Documents and Settings\user\TEST.dmp
You can copy to D:\DUMPS\TEST.dmp and use this file with IMP as
  imp user/password file='D:\DUMPS\TEST.DMP' 
Regards
Mahir M. Quluzade
Marked as Answer by 875255 · Sep 27 2020
875255
do we have an option like some software which automatically(makes backup after a specified period like after every hour) makes backup of the whole database as .dmp and saves it to specified location?????
JustinCave
1) Although a dump file is a logical backup, I sincerely hope you are not using it as your primary method of backing up a database. You need physical backups (RMAN or user-managed). Logical backups can compliment but not replace physical backups.

2) You could certainly schedule the export utility to run regularly and to write files to whatever location you desire. It would be exceedingly unusual to want a full database export every hour however. That generally implies that you're doing something wrong.

3) This doesn't appear to relate to database security. It would probably be more appropriate in the Export/Import/SQL Loader and External Tables forum or even in the Database - General forum.

Justin

Edited by: Justin Cave on Jun 23, 2012 1:30 AM
1 - 5

Post Details

Added on Aug 30 2021
13 comments
1,592 views