2 Replies - 701 Views - Last Post: 13 July 2011 - 07:02 AM Rate Topic: -----

#1 metador  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 21
  • Joined: 18-June 11

How to restrict user to single entry per month through query

Posted 13 July 2011 - 06:43 AM

hello all,

i have a little problem in my salary table that there is a form having datetimepicker and salary textbox and empCombobox. When emp is selected from combobox then its record display in datetimepicker and salry textbox.know i want that only once a month record should be inserted i mean to retrict through datetimepicker that if month change then allow to enter next month salary.
e.g i entered salary 200 in salary textbox
datetimepicker.value = 7/14/2011

after that this record of emp should be only updated til this month(7) when month(8) starts then next month salary should be inserted.
so plz guide me . i uses Like '%.... %' but its not working
"SELECT * FROM Salary WHERE EmployeeID =" +cmbSelectEmpolyee.SelectedValue + ";";


Is This A Good Question/Topic? 0
  • +

Replies To: How to restrict user to single entry per month through query

#2 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

Re: How to restrict user to single entry per month through query

Posted 13 July 2011 - 06:47 AM

each salary record should have information about when it was inserted... then before update-ing it, check the date value... if it's in the same month => don't allow to update it...

Why are you even updating same salary record... you really should have new salary record for each employee each month... You need to keep track of employee salaries...

best regards
Was This Post Helpful? 2
  • +
  • -

#3 metador  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 21
  • Joined: 18-June 11

Re: How to restrict user to single entry per month through query

Posted 13 July 2011 - 07:02 AM

Thanks for help.I got first point.
actually employee salaries are not fixed for each month.So manually enter each month.
And kindly give me one more help that when i change date from datetimepicker suppose select last month any date then how that month salary should display in salary textbox means after calling this event
private void dateTimePicker1_ValueChanged_1(object sender, EventArgs e)



View PostFlashM, on 13 July 2011 - 06:47 AM, said:

each salary record should have information about when it was inserted... then before update-ing it, check the date value... if it's in the same month => don't allow to update it...

Why are you even updating same salary record... you really should have new salary record for each employee each month... You need to keep track of employee salaries...

best regards

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1