how to insert the record into the database by date/time .The same id will not inserted another time until a month over..
For example, take salary detail if we inserted employee by the employee ID with date/time in the database about the salary detail ..the same person Id could not inserted again until the one month....If one month over we can insert the same faculty details again...
Thanks in Advance
Loading
Sam HobbsPosted May 11, 2011, 10:08 PM
Vijay YadavPosted May 11, 2011, 6:13 AM
Vijay YadavPosted May 11, 2011, 6:12 AM
I have done the same thing in my project.
Like this,
int i = 0;
int x = DateTime.Now.Month;
int y = DateTime.Now.Year;
if (x == 12)
{
i = 1;
y = y + 1;
}
else
i = DateTime.Now.Month + 1;
int m=DateTime.DaysInMonth(y,i);
string s = i + "/01/" + y + " 12:00:00 PM";
string ss=i+"/"+m+"/"+y +" 11:59:59 PM"; // the date format is in yyyy/MM/dd hh:mm:ss
then your select query
for example: select Emp_Name from table where date between 's' and 'ss'
Dorababu MekaPosted May 11, 2011, 5:50 AM