|
In a management system, I use two datetimepicker controls to indicate the starting year and month and ending year and month of the rent paid. The style is set to up and down arrow, and the format is set to display only the year and month, because there is no 30 in February. And on the 31st, when the current date is 30 or 31, an error occurs when the month is changed to 2. A friend helped me solve this problem in the post, that is, first set datetimepicker2.date:=startofthemonth(now), now Encountered a new problem: when entering the time into the database, you need to set the date of datetimepicker2 to the last day of the month. Otherwise, when the query condition is time, the query will be one month less. I tried to write such code in the onExit event of the datetimepicker: datetimepicker2.date:=endofthemonth(datetimepicker2.date), but it didn't work at all. Which hero can help me solve it. |
|