473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get decimal to date form

In our database is a decimal field with format YYMMDDhhmmss.99 99999999
where the 9s are random digits. I'm trying to strip off just the
YYMMDD and put it in date form.

So far I came up with:
SUBSTR(TO_CHAR( rec_num,9999999 9999),1,6) AS Date which returns YMMDD.

For example where the rec_num is 30608124143.470 69519725 the above
functions return 30608.

I tried wrapping another TO_CHAR around it to try to format it to a
date but this seems like it's a bit much for this purpose.

Any suggestions would be appreciated.

-David
Jul 20 '05 #1
2 4600

"wireless" <wi*********@ya hoo.com> wrote in message
news:90******** *************** **@posting.goog le.com...
In our database is a decimal field with format YYMMDDhhmmss.99 99999999
where the 9s are random digits. I'm trying to strip off just the
YYMMDD and put it in date form.

So far I came up with:
SUBSTR(TO_CHAR( rec_num,9999999 9999),1,6) AS Date which returns YMMDD.

For example where the rec_num is 30608124143.470 69519725 the above
functions return 30608.

I tried wrapping another TO_CHAR around it to try to format it to a
date but this seems like it's a bit much for this purpose.

Any suggestions would be appreciated.

-David


I think you may have posted this to the wrong group - SUBSTR() and TO_CHAR()
are not MS SQL Server functions.

Simon
Jul 20 '05 #2
"Simon Hayes" <sq*@hayes.ch > wrote:
I think you may have posted this to the wrong group - SUBSTR() and TO_CHAR()
are not MS SQL Server functions.


Yes, right. We've got three different database types here (MS,
Oracle,and Postgre) and sometimes the tsql runs together with the
psql. :o?
-David (I wish they were all sql servers)
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5526
by: tamrakar | last post by:
Please let me know how I can Load a packed decimal date coming from a file from mainframe be loaded into a Oracle table date column? Any help will be appreciated. Thanks,
1
1353
by: s commar | last post by:
Hi I have a Platinum database which stores dates in integer form e.g the date is formatted as below: Column_name Type Length Precision ------------------------------ ------------------------------ from_date int 4 10
4
24434
by: Lisa Jones | last post by:
Hi Can someone tell me How do you get selected date form MonthCalendar control Thanks so muc Lisa
1
1999
by: DawnAnne1974 | last post by:
I need to set a default date on a form that when it comes to a Monday, the form from and to dates will default to the Friday to Sunday of the previous week. For all other day, the form should default to the previous day. Can anyone help? Thanks in advance
5
43829
by: Ray | last post by:
I have a table with some audit date and time columns. Problem is the developer who stored the data left them as DECIMAL type instead of DATE and TIME. Is there a way I can convert the DECIMAL type to DATE or TIME? The column data is in the date form YYYYMMDD (i.e. 20060308 = March 8 2006). I want to get the data into a DATE type. I tried TO_DATE('20060308','YYYYMMDD') but I cannot get it to work. What else can I do to conver the data...
1
1455
by: ranjit189 | last post by:
i got the date from oracle database using servlet programming string dt=x.getDatabaseValue("select sysdate from dual"); my problem is i got nother date i have entered now i want to compare both but the format i assigned like String dt is not correct can anyone help
0
1148
by: marianna | last post by:
hi everyone, i have aquestion with a programm of mine.I want to take a date from my database and when the query returns it it is like that:$row.So i guess it becomes a string or a variable. how can i use this string or variable to an sql query to see if this date is equal to another date?
1
2429
by: sravan_reddy001 | last post by:
how can get the date selected in the monthCalander Control i'm able to see the selectionstart property but its displaying the date and the start time (i.e) 12:00:00 AM i used the following code to get the date selected in the monthCalander control DateTime date = new DateTime(); date = Convert.ToDateTime(monthCalendar1.SelectionStart);
9
4683
by: Frank Swarbrick | last post by:
I've probably asked this before, but I can't remember the answer! One can use the DECIMAL function to convert a date to a decimal. For instance values decimal(current_date) returns 20080528. Is there an easy way to convert the decimal value back to a date? I can't use DATE(<decimal-value>) because it expects the decimal value to be the number of days since Jan 1, 0001.
0
7959
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8263
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5421
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3876
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2393
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.