Hey guys!

Im having a little problem with my datetimepicker!Im making a personal payroll system,where I want to add employee's daily hours!for example:

Employee name:Marcus Veron
IdPayroll:032012

Date|Hours

19/07/2012 | 8
20/07/2012 | 8
21/07/2012 | 7

Well im having problem quering the date field...cause in my datetimepicker i have it custom formated to dd/MM/yyyy but in the database its MM/dd/yyyy.I guess thats where the problem is.When I run this query "Select * From WorkedHours where EmployeeID="employee ID" and PayrollID="Payroll ID" and Date="dtphours.text".

I want it to look if the date exist then update the hours if not then create new registry.How do I do this?I have tried formating the dtp but still it doesnt read the date!!please Help!!

Recommended Answers

All 5 Replies

Change the format of your date string before you pass it to the query(i.e. TempDateString = Format(dtphours.text, "yyyy/mm/dd").

Still same problem!

sorry didn't change the format string, TempDateString = Format(dtphours.text, "MM/dd/yyyy"). Also you'll have to pass TempdateString to the database not dtphours.text

Also, you want to use the DTP's .Value attribute, not .Text

Thanx tinstaafl and Begginerdev u guys rock!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.