| |
|
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.
|
 |

06-28-10, 13:42
|
|
Registered User
|
|
Join Date: Jun 2010
Posts: 2
|
|
|
Convert date format to yyyymmdd
|
|
Here is a snippet of my code. On all my date formats i need to pull the date out in this format yyyymmdd how do I do that my date is in mm/dd/yyyy thanks! If I am not posting according to the Rules or incorrectly please let me know I am new here.
select
inv.org_code,
inv_shp.cust_num,
cust_name,
" " cust_po_num,
inv_shp_l_lot.item_num,
item.desc_1,
inv_shp_l_lot.lot_code,
order_type_code,
min (shipped_date) first_shipped,
max (shipped_date) last_shipped,
sum(inv_shp_l.shipped_qty) Qty_shipped,
inv_shp_l.tot_net_amt/inv_shp_l.shipped_qty saleWAC,"",""
|
Last edited by logle0917; 06-29-10 at 17:39.
|

07-07-10, 13:08
|
|
Registered User
|
|
Join Date: May 2004
Location: New York
Posts: 248
|
|
just use the datetime function
|
|

07-27-10, 02:26
|
|
Registered User
|
|
Join Date: Jul 2010
Location: Singapore
Posts: 1
|
|
|
|
Hai everybody, i am a new member to forums, so i am intereseted
and want to gain knowledge on this topics..........................thanku
|
|

07-30-10, 04:27
|
|
Registered User
|
|
Join Date: Jul 2010
Location: america
Posts: 1
|
|
Hai, I am a new member just joined the community and want to gain knowledge
about the above disscuisions from the others members. thank you
|
|

08-03-10, 08:25
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 1
|
|
Wow thanks for the information.
|
|

08-03-10, 20:49
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 1
|
|
I am also new here and I really want to learn more on how to convert date formats and codes. hoppe I can get something from here.
|
|

08-09-10, 14:30
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 13
|
|
|
Date format modification:
Quote:
Originally Posted by logle0917
Here is a snippet of my code. On all my date formats i need to pull the date out in this format yyyymmdd how do I do that my date is in mm/dd/yyyy thanks! If I am not posting according to the Rules or incorrectly please let me know I am new here.
select
inv.org_code,
inv_shp.cust_num,
cust_name,
" " cust_po_num,
inv_shp_l_lot.item_num,
item.desc_1,
inv_shp_l_lot.lot_code,
order_type_code,
min (shipped_date) first_shipped,
max (shipped_date) last_shipped,
sum(inv_shp_l.shipped_qty) Qty_shipped,
inv_shp_l.tot_net_amt/inv_shp_l.shipped_qty saleWAC,"",""
|
-----------------------------
I am currently working with SQL SERVER but this code above looks like Oracle(PL/SQL).
Try to_date(to_char(@date_var,"YYYYMMDD),"YYYYMMDD")
The inside function will yield a char string output and the outside function
will convert it back into a date format , for you to use in further processing.
-SK
|
|

08-11-10, 13:16
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 1
|
|
|
|

08-16-10, 18:39
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 1
|
|
thanks I found a snippet for my date stamp yet I need a time stamp too 
|
|

09-05-10, 11:24
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 1
|
|
this is i am looking for! thanks dude for sharing this information. it really a great help. more power! 
|
|

09-21-10, 08:52
|
|
Registered User
|
|
Join Date: Sep 2010
Location: Germany, Brunswick
Posts: 52
|
|
You can set the environment variable DBDATE to "Y4MD0":
export DBDATE=Y4MD0
Or use the function "TO_CHAR":
to_char(shipped_date, "%Y%m%d")
Code:
select
inv.org_code,
inv_shp.cust_num,
cust_name,
" " cust_po_num,
inv_shp_l_lot.item_num,
item.desc_1,
inv_shp_l_lot.lot_code,
order_type_code,
to_char(min (shipped_date), "%Y%m%d") first_shipped,
to_char(max (shipped_date), "%Y%m%d") last_shipped,
sum(inv_shp_l.shipped_qty) Qty_shipped,
inv_shp_l.tot_net_amt/inv_shp_l.shipped_qty saleWAC,"",""
|
|

10-08-10, 20:58
|
|
Registered User
|
|
Join Date: Oct 2010
Posts: 1
|
|
Hi all! I am also a new member here..and interested to know about thesse things..thanks!
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|