Python Forum
[PyQt] to display cotent of database between two dates
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] to display cotent of database between two dates
#6
for information; the column "date_correction" of the table "correction_loc35R" is programmed like TEXT
to recover the start date entered by the user; we created the following function :

def join_start_date(self):
    try:
        start_day = int(self.lineEdit_start_day.text())
        start_month = int(self.lineEdit_start_month.text())
        start_year = int(self.lineEdit_start_year.text())
        start_date = dt.date(start_year, start_month, start_day)
        
    except ValueError:    
		print("error")
        
    else:
        self.lineEdit_start_date_writted.setText("{:%d-%m-%Y}".format(start_date))
        print("OK")
to recover the end date entered by the user; we created the following function :

def join_end_date(self):
    try:
        end_day = int(self.lineEdit_end_day.text())
        end_month = int(self.lineEdit_end_month.text())
        end_year = int(self.lineEdit_end_year.text())
        end_date = dt.date(end_year, end_month, end_day)
        
    except ValueError:    
		print("error")
        
    else:
        self.lineEdit_end_date_writted.setText("{:%d-%m-%Y}".format(end_date))
        print("OK")
and here is a descriptive picture of the input blocks of the start date and the end date

[Image: dkph.jpg]
Reply


Messages In This Thread
RE: to display cotent of database between two dates - by atlass218 - Dec-26-2019, 06:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Display and update the label text which display the serial value jenkins43 5 9,098 Feb-04-2019, 04:36 AM
Last Post: Larz60+
  Display more than one button in GUI to display MPU6000 Sensor readings barry76 4 3,901 Jan-05-2019, 01:48 PM
Last Post: wuf

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020