473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Plzzz help regarding this......

I hv a datetime format like '24/01/2008 15:56:01' . Now I have to select dates from a date range, but input datetime format like 24/1/2008 15:56:01'.
I hv written the query like :

"select date_column from date_table where to_char(date_column,'dd/mm/yyyy hh24:mi:ss') between input_date and input_date; "

here I face a problem that when the date range within a month, it works fine.
but when it become greater may be 2 or 6 month date range it does not work...

Plzzz help regarding this......
Jan 25 '08 #1
4 1590
debasisdas
8,127 Expert 4TB
try to use this
Expand|Select|Wrap|Line Numbers
  1. select date_column from date_table where date_column between to_char(input_date,'dd/mm/yyyy hh24:mi:ss') and to_char(input_date1,'dd/mm/yyyy hh24:mi:ss')
Jan 25 '08 #2
try to use this
Expand|Select|Wrap|Line Numbers
  1. select date_column from date_table where date_column between to_char(input_date,'dd/mm/yyyy hh24:mi:ss') and to_char(input_date1,'dd/mm/yyyy hh24:mi:ss')
I have get the error :.. "ORA-01722: invalid number"
Jan 25 '08 #3
debasisdas
8,127 Expert 4TB
I have get the error :.. "ORA-01722: invalid number"
just rry to pass the inoput date in this format

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table_name WHERE to_char(date_field,'dd-mon-yyyy hh24:mi:ss') BETWEEN '01-jan-1991 01:02:03' AND '31-dec-1998 23:05:34';
  2.  
Jan 25 '08 #4
Expand|Select|Wrap|Line Numbers
  1. Select Hiredate,to_date(to_char(hiredate,'dd/mm/yy Hh24:mi:ss'),'dd/mm/yy Hh24:mi:ss') From Emp
  2. Where Hiredate Between To_char('12-01-80','dd/mm/yy Hh24:mi:ss') And To_char(sysdate,'dd/mm/yy Hh24:mi:ss')
  3.  
Jan 30 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Francis Lavoie | last post by:
Hello I have some questions regarding webframework, I must say that I quite lost and these questions are basicly to help me understand the way it work. I have some knowledge with PHP and JSP....
7
by: Squignibbler | last post by:
Hi all, I have a question regarding the C++ programming language regarding the nature of the relationship between pointers and arrays. If the statement MyArray is functionally identical to...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Islamegy® | last post by:
Hi, I'm C# Developer re-write VB6 Application to C#.Net, also support the old VB6 till i finish the project.. I Try to use VB6 Visual data manager to create a DataEnviroment connection and 3...
3
by: tamerania2004 | last post by:
help me to answer some q in c# plzzzzzzzzzzzzzz link :cry: :cry: :cry: :cry: http://www.sendspace.com/file/gd1o99 ---------------------------------- http://community.ihostasp.net
0
by: mahesh123 | last post by:
Hi, I am new to use the crystal reports8.0. I am facing the problem regarding the database connection through the ADO Connection. Suppose my database name is "sample.pra"(due to some security...
1
by: elsa | last post by:
My instructer has given me a backward question to answer!! how can we describe the process of normalization that led to this table to 4NF? wardName ------ staffName---- ...
0
by: lksath | last post by:
This is the code i am using now.But i want to autosize the grid size according to the datasize..Anyone plz help... DataGridTableStyle tabstyle=new DataGridTableStyle(); ...
2
by: biplab | last post by:
I have a minor problem with the following code..it reads a .bmp image and is supposed to produce another .bmp image which is the result of histogram equalization of the input image...kindly go...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.