Want to display based on date...............
-
hi i have two tables like want to display based on the date: eg: table1: Id cardDate Intime1 Outtime1 1 12/22/2006 09:00 20:00 2 12/22/2007 09:00 20:00 3 12/22/2006 09:00 13:00 and table 2: Id leaveDate Intime2 Outtime2 3 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 5 11/11/2006 09:00 20:00 If i select the date 12/22/2006" then it want to display like: Id Carddate InTime1 Outtime1 Leavedate Intime2 Outtime2 1 12/22/2006 09:00 20:00 null null null 3 12/22/2006 09:00 13:00 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 null null null I am week in sqlquery,plz hlp me...,
Magi
-
hi i have two tables like want to display based on the date: eg: table1: Id cardDate Intime1 Outtime1 1 12/22/2006 09:00 20:00 2 12/22/2007 09:00 20:00 3 12/22/2006 09:00 13:00 and table 2: Id leaveDate Intime2 Outtime2 3 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 5 11/11/2006 09:00 20:00 If i select the date 12/22/2006" then it want to display like: Id Carddate InTime1 Outtime1 Leavedate Intime2 Outtime2 1 12/22/2006 09:00 20:00 null null null 3 12/22/2006 09:00 13:00 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 null null null I am week in sqlquery,plz hlp me...,
Magi
-
your sql query should like this
select a.*,b.* from teble1 a, table2 b, where datedifff(dd,a.carddate,b.leavedate) = 0
No it willn't work taht much exactly See once again my pre msg output.........,
Magi
-
hi i have two tables like want to display based on the date: eg: table1: Id cardDate Intime1 Outtime1 1 12/22/2006 09:00 20:00 2 12/22/2007 09:00 20:00 3 12/22/2006 09:00 13:00 and table 2: Id leaveDate Intime2 Outtime2 3 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 5 11/11/2006 09:00 20:00 If i select the date 12/22/2006" then it want to display like: Id Carddate InTime1 Outtime1 Leavedate Intime2 Outtime2 1 12/22/2006 09:00 20:00 null null null 3 12/22/2006 09:00 13:00 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 null null null I am week in sqlquery,plz hlp me...,
Magi
select CD.*,LD.* from Table1 as CD,Table2 as LD where cd.carddate=ld.leavedate and CD.carddate='"+ inputdate +"' and LD.leavedate='"+ inputdate +"';
I think it will be helpful to u Best regards PathanGOD HELP THOSE WHO HELP THEMSELVES
-
hi i have two tables like want to display based on the date: eg: table1: Id cardDate Intime1 Outtime1 1 12/22/2006 09:00 20:00 2 12/22/2007 09:00 20:00 3 12/22/2006 09:00 13:00 and table 2: Id leaveDate Intime2 Outtime2 3 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 5 11/11/2006 09:00 20:00 If i select the date 12/22/2006" then it want to display like: Id Carddate InTime1 Outtime1 Leavedate Intime2 Outtime2 1 12/22/2006 09:00 20:00 null null null 3 12/22/2006 09:00 13:00 12/22/2006 13:00 20:00 4 12/22/2006 09:00 20:00 null null null I am week in sqlquery,plz hlp me...,
Magi
Please, if you have a question, ask in the correct forum, and no-where else. Don't spam half the site.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )