Hello,
I am trying to display records by date range and am having trouble, below
is the method I am using, I would like to use the calander date picker to populate both the globals with data??, I am very sure there is someone who has done this, and I would really appreciate some assistance please.
Regards
Phil R
//set date range for display
controller.find()
invoice_date = 'globals.searchInvStartD...globals.searchInvEndD'
controller.search(true,false)
//reset display list to show all records
globals.searchCompanyname = ""
//set date range for display
controller.find()
invoice_date = globals.searchInvStartD + '...' + globals.searchInvEndD
controller.search(true,false)
//reset display list to show all records
globals.searchCompanyname = "
or another one:
//set date range for display
controller.find()
invoice_date = utils.dateFormat(globals.searchInvStartD,'dd-MM-yyyy HH:mm') + '...' + utils.dateFormat(globals.searchInvEndD,'dd-MM-yyyy HH:mm')
controller.search(true,false)
//reset display list to show all records
globals.searchCompanyname = "
Many Thanks for you reply, but I am still having problems I enabled the debugger and it seems that the varibles are not being populated with data, well they are not being reported under varibles in the debugger window. Is the below code OK??
//set date range for display
controller.find()
[b]invoice_date = globals.searchInvStartD + '...' + globals.searchInvEndD[/b]
controller.search(true,false)
//reset display list to show all records
//globals.searchCompanyname = ""
prj311:
Many Thanks for you reply, but I am still having problems I enabled the debugger and it seems that the varibles are not being populated with data, well they are not being reported under varibles in the debugger window. Is the below code OK??
//set date range for display
controller.find()
invoice_date = globals.searchInvStartD + ‘…’ + globals.searchInvEndD
controller.search(true,false)
//reset display list to show all records //globals.searchCompanyname = “”
of course a global is a variable. It is a variable (meaning you can change the content at anytime) that is addresable throughout the whole applications. Global means placed on the globals variable stack as opposed to local variables whos scope is limited to the method they are created in.
I have intensionally commented out the controller.search() function just to see what data is returned to feild invoice_date.
After chosing the search dates I get the following in the invoice_date feild
01-03-2006…28-03-2006
which should work, but it does not.
If I go into find mode manually and type the above manually it works, also if I remove the preceeding zeros it works eg
Servoy Help (Content > Getting Started > Finding Data > Finding Dates and Time) states the following:
Finding a range of dates To search for a range of dates, be sure to include the display value; a pipe character |; and the edit value as part of your search criteria.
Example:
//performs a find for a date range in startDateTime
controller.find();
startDateTime = '1-1-2004...1-30-2004|MM-dd-yyyy';
controller.search();