Home » SQL & PL/SQL » SQL & PL/SQL » to get date in weeks
to get date in weeks [message #278139] Fri, 02 November 2007 01:17 Go to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member

sir i have few doubt on date base query.
 SELECT DISTINCT SUBSTR(a.VC_SCHEDULE_NO,3) "SCHEDULE NO", a.DT_SCHEDULE_DATE, a.DT_ORD_SCHEDULE,c.vc_customer_name,
  SUBSTR(b.vc_prof_inv_no,3) ord_no,TO_CHAR(b.dt_prof_date,'dd-mm-yyyy') order_date,b.vc_exp_reference Customer_order_no,
  b.dt_exp_reference customer_ord_date, b.dt_delivery_date, e.vc_product_name, f.tot_qty, d.dt_month_year, d.NU_QUANTITY
   FROM EXPORT.HD_EXP_ORDER_SCHEDULE a, export.hd_proforma_inv b, makess.mst_customer c, 
   export.exp_month_schedule d, mst_product e, export.dt_exp_order_schedule f
   WHERE a.vc_comp_code=:comp_code
   AND a.vc_comp_code=b.vc_comp_code
   AND b.vc_comp_code=c.vc_comp_code
   AND c.vc_comp_code=d.vc_comp_code
   AND d.vc_comp_code=e.vc_comp_code
   AND e.vc_comp_code=f.vc_comp_code
    AND NVL(c.vc_field3,'N') != 'Y' 
	AND b.nu_customer_Code = c.nu_customer_code
	AND d.VC_PRODUCT_CODE=e.VC_PRODUCT_CODE
	AND e.VC_PRODUCT_CODE=f.VC_PRODUCT_CODE
	AND SUBSTR(a.VC_SCHEDULE_NO,3)=:sched_no
	AND a.VC_PROF_INV_NO=b.VC_PROF_INV_NO
	AND a.VC_PROF_INV_NO=d.VC_PROF_INV_NO
	AND  a.VC_PROF_INV_NO=f.VC_PROF_INV_NO
	AND a.DT_PROF_DATE=b.DT_PROF_DATE
	AND  a.DT_PROF_DATE=d.DT_PROF_DATE
	AND  a.DT_PROF_DATE=f.DT_PROF_DATE
	AND a.DT_SCHEDULE_DATE=:sched_date
    ORDER BY TO_NUMBER(SUBSTR(a.VC_SCHEDULE_NO,3))


i want date in week so that user can know which week's scheduled is done inplace of date i.e(01-11-2007) it come between the week.

please help me to solve the problem...

regards
Re: to get date in weeks [message #278142 is a reply to message #278139] Fri, 02 November 2007 01:32 Go to previous message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
Take a look what's possible with the TO_CHAR function, you'll find the answer right there

TO_CHAR

Format Models

[Updated on: Fri, 02 November 2007 04:20]

Report message to a moderator

Previous Topic: Dynamic strings
Next Topic: How to declare the parameter as cursor
Goto Forum:
  


Current Time: Sun Dec 04 11:00:10 CST 2016

Total time taken to generate the page: 0.07911 seconds