creating view for Month filter facility
-
hello all, am working with sqlserver 2000 am using view option for retrieve values in a table.am using vb.net(Vs 2005) as my Front End. my problem is whenever i retrieve values from the database it simply retrieves the first row of the database. but in my case i want to retrieve data's which wasmodified by Last month. am declring one field as month. in that am getting value like jan 07, feb 07, etc.... can i able to filter last month modified data's and then move it to a view and then retriving data's from that view, is it possible please give me suggestions as well as solutions...... Thanks
-
hello all, am working with sqlserver 2000 am using view option for retrieve values in a table.am using vb.net(Vs 2005) as my Front End. my problem is whenever i retrieve values from the database it simply retrieves the first row of the database. but in my case i want to retrieve data's which wasmodified by Last month. am declring one field as month. in that am getting value like jan 07, feb 07, etc.... can i able to filter last month modified data's and then move it to a view and then retriving data's from that view, is it possible please give me suggestions as well as solutions...... Thanks
while fetching from SQL Server it is possible, to filter for a specific month & year. for example if the modify_dt is the column with datetime datatype where clause for fetching this can be 1. WHERE modify_dt BETWEEN AND 2. WHERE month(modify_dt) = AND year(modify_dt) = if is for previous month (current month is Feb then prev. is Jan) WHERE month(modify_dt) = month(getdate) - 1 AND year(modify_dt) = year(getdate()) -- modified at 22:45 Tuesday 13th February, 2007
-
while fetching from SQL Server it is possible, to filter for a specific month & year. for example if the modify_dt is the column with datetime datatype where clause for fetching this can be 1. WHERE modify_dt BETWEEN AND 2. WHERE month(modify_dt) = AND year(modify_dt) = if is for previous month (current month is Feb then prev. is Jan) WHERE month(modify_dt) = month(getdate) - 1 AND year(modify_dt) = year(getdate()) -- modified at 22:45 Tuesday 13th February, 2007
Thanks For U r Reply. but i am declaring that month fields as nvarchar, am also uploaod all the databases from excel to Sql. Now is it Possible to get Last month Details? That table contain 42 fields and also No of records in it is nearly 850. Please help me to avoid olderdata's getting repeated. only i want last month Modified Records. Please tell me any other way to solve this Issue.:^).. Thank You
-
Thanks For U r Reply. but i am declaring that month fields as nvarchar, am also uploaod all the databases from excel to Sql. Now is it Possible to get Last month Details? That table contain 42 fields and also No of records in it is nearly 850. Please help me to avoid olderdata's getting repeated. only i want last month Modified Records. Please tell me any other way to solve this Issue.:^).. Thank You