Date Range Reporting Primer Tutorial

Date Range Reporting Primer Tutorial

Date Range Reporting Primer Tutorial

Are you always satisfied with Search and/or Advanced Search functionality on websites? We’d say “sometimes”, but understand that some of the access to “Advanced Search” is debatable for webmasters given it can lead to database searches of some complexity, that might slow down their web server considerably. Just consider a database SQL query …


SELECT * FROM placenamesintheworld WHERE placename = 'Adelaide';

… as distinct from (the one character different) …


SELECT * FROM placenamesintheworld WHERE placename >= 'Adelaide';

That one extra “>” means little to the SQL interpreter but could mean a lot to web server performance. When we approach “Advanced Search” functionality on public websites, we are not surprised when restrictions are applied.

If you are into data migration you may often know that jobs need to be broken up into manageable chunks of work. It is the same with “Advanced Search” quite often.

And so to day’s date range “Advanced Search” requirement we have for today’s tutorial. We found on the NSW Government Legislation website’s “Advanced Search” “CCL query” functionality some inconsistencies when involving queries greater than (ie. using “>”) showed inconsistency (perhaps depending on your FirstValid Date start date, we are not sure), but no such inconsistency just involving (date) equality (ie. only involving “=” as any operator in the CCL query). So we decided to break the job up, writing an inhouse interface date range asker that behind the scenes only uses equality query parts to the several CCL queries it runs.

This is a PHP job, because …

  • it needs to output file data (in the output HTML report) … and …
  • it uses file_get_contents to extract its report data

You can see how today’s PHP nswstuff.php works at this live run link.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>