sudhakarpothu
Programmer
Hello Friends,
I have a problem with retreiving data from my oracle database using sql select statement.
here I am using a user form in vb to get the data from a begining date to ending date, my database has different coloumns for Year, month and Day
Here the problem is, the earlier programmer created the tables such that they take date in year, month and day as separate columns.
when i try to retreive data its checking these columns as separate fields but not as date.
my sql select staterment is
select wölbung_vorn, wölbung_hinten, Year, Month, Day from rsv.twm60 where Year>='" & Byear & "' and Year <='" & Eyear & "' and Month>='" & Bmonth & "' and Month<='" & Emonth & "' and Day>='" & Bday & "' and Day<='" & Eday & "'"
what i am trying is to take the input ( in user form ) as
Byear=2005 and Eyear=2006 ie is year between 2005 and 2006
Bmonth=1 and Emonth= 12 ie is month between 1 and 12
Bday=1 and Eday=8 ie is day between 1 and 8
so i am expecting it to return me all values from 1-1-2005 to 8-12-2006 but thats not happening it is just giving values of 2005 january 1 to 8 and december 1 to 8
and values from 2006 january 1 to 8 and december 1 to 8.
Please help me, I am trying to solve this by nested select statement but not getting.
sorry for taking your valuable time
Thank you.
Sudhakar Pothu.
I have a problem with retreiving data from my oracle database using sql select statement.
here I am using a user form in vb to get the data from a begining date to ending date, my database has different coloumns for Year, month and Day
Here the problem is, the earlier programmer created the tables such that they take date in year, month and day as separate columns.
when i try to retreive data its checking these columns as separate fields but not as date.
my sql select staterment is
select wölbung_vorn, wölbung_hinten, Year, Month, Day from rsv.twm60 where Year>='" & Byear & "' and Year <='" & Eyear & "' and Month>='" & Bmonth & "' and Month<='" & Emonth & "' and Day>='" & Bday & "' and Day<='" & Eday & "'"
what i am trying is to take the input ( in user form ) as
Byear=2005 and Eyear=2006 ie is year between 2005 and 2006
Bmonth=1 and Emonth= 12 ie is month between 1 and 12
Bday=1 and Eday=8 ie is day between 1 and 8
so i am expecting it to return me all values from 1-1-2005 to 8-12-2006 but thats not happening it is just giving values of 2005 january 1 to 8 and december 1 to 8
and values from 2006 january 1 to 8 and december 1 to 8.
Please help me, I am trying to solve this by nested select statement but not getting.
sorry for taking your valuable time
Thank you.
Sudhakar Pothu.