hey there,
i m trying to get only time information of a date type variable.
i got a column in type of char, it keeps time info in hh:mm format - 5 characters
when i tried to convert it to date with to_date([variable], 'hh24:mi') it gives me a date starts with the ifrst day of current mount, year etc.
01/10/2008 14:04 for example.
i need a solution to get time info in date data type from a char column in hh:mm
thanx for ypur care...
6 11430
Your requimrent is not clear.Are you trying to convert the char data in to time format or are you trying to extract a time from a current date?
i m trying to convert char data (for example 15:30) into date data type.
to_date('15:30' ,'hh24:mi') function gives it to me with a date that belong to first day of the current mount. for example as 01/10/2008 15:30 i f we cosider today. i need only time info.
thanks for your care...
Gözde
You can store both date a dnd time in a date value .Which can later be extracted as desired for any processing or rerporting purpose.
i m trying to convert char data (for example 15:30) into date data type.
to_date('15:30' ,'hh24:mi') function gives it to me with a date that belong to first day of the current mount. for example as 01/10/2008 15:30 i f we cosider today. i need only time info.
thanks for your care...
Gözde
Use TO_CHAR(column_ name,'HH24:MI') or TO_CHAR(TO_DATE ('15:30','HH24: MI'),'HH24:MI')
Use TO_CHAR(column_ name,'HH24:MI') or TO_CHAR(TO_DATE ('15:30','HH24: MI'),'HH24:MI')
sorry that i think i couldn't explain my problem clearly
above fınctions gives it to me as character. i need time info in date type. when i use to_date() with 'hh24:mi' it gives me with an unwanted date info. i need only time...
try to use EXTRACT function.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Yong Wang |
last post by:
> Hi:
> We have a database system. In the database, we have an
> attribute called date0, which contains date data (format:
> i. e. 2004-08-12). I wrote a script to fetch the data
> in a specified time period:
> for exaplme:
> date1 = raw_input('start date ')
> date2 = raw_input('end date ')
>
> ie. date1 = '2004-08-12'
|
by: John Cosmas |
last post by:
I've encountered a table that stores dates in Gregorian format so that the
dates and time looks like straight integers that cannot be easily discrened
as a date or time by just looking at it. I'm using SQL to query the table
and retrieve the data as an integer. I'm tyring to figure out how to best
CAST or CONVERT the field into a DATE type so that its readable in the right
format. I'm coding in VB.NET and the use of CDATE and FORMAT have...
|
by: Remi Caron |
last post by:
Hi,
I took over an Visual Object project (Visual Clipper) in that language there
is a function to: Convert a string containing a 32-bit binary date to a date
data type. That function is called bin2Date and there also is a Date2bin
function of course in cannot find how to do this in csharp. The string looks
like this "!$%\0" and should return 03/09/52 can somebody point me in the
right direction? Have tried Convert class in several ways...
|
by: Alan |
last post by:
Any data type that I can use to store date ?
|
by: glenn |
last post by:
Hi folks,
I am doing an UPDATE to a table that has a field for a DATE data type. I am
using MS Access.
The UPDATE works fine but when I try to place the DATE field in the mix it
blows up.
The table name is rfi.
| |
by: glenn |
last post by:
Hi folks,
I have 2 code snippets. One works and one does not.
This first hard-coded snippet works
Dim queryString As String = "UPDATE SET = '8/16/2006'
WHERE (. = @id)"
This second snippet does not work
|
by: shubhangi |
last post by:
Hi,
I want to enter only time from frontend & not date time.
Can I do this & can I store this in DB. If yes, what will be data type to store only time values. How do I retrieve the time data in case I want to find difference.
Please reply.
Thanks
Shubhangi
|
by: loisk |
last post by:
Hi,
I need to compare a date (on a form )entered by a user with today's date and a date should not be greater than today. The problem, however, the data type for the date is string, not date date type. Is there anyway that I can test the user-entered-date against today's date? Thanks!
|
by: dkyadav80 |
last post by:
Hi guys,
I have a form in html , all description below:
first: name of persion (input type box)
second: job profile (input type box)
third: experience from: list box (Month : Jan, Feb,.. format) and
experience to: list box (year: 2008,2007,2006,...)
In Mysql database only 4 filed,
1. Name(data type - varchar),
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
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,...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |