Source language: Translate to:

Report Designer - Issues with update after query

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Report Designer - Issues with update after query

Postby kpmcginley » Sun Jun 22, 2008 11:45 am

A quick search of relevant posts reveals nothing like the experience I am having, so I will add this post. I have designed a report and set up an option to either preview or print the report. I have also designed a search subroutine. When I query the db and then display the report, it is incorrect. It shows all the records. However, if I press search again, it correctly diisplays the query results.

This is the code I am using:
Code: Select all
DateToNum "[SearchBeginDate]" "m/d/y" "[SearchBeginDateJ]"
DateToNum "[SearchEndDate]" "m/d/y" "[SearchEndDateJ]"
.AlertBox "Check" "SearchBeginDateJ = [SearchBeginDateJ]| SearchEndDateJ = [SearchEndDateJ]"
IfEx "[searchbegindateJ] <> [#34][#34] and [SearchEndDateJ] <> [#34][#34]"
dbpQuery "checkin" "ds" "dischargejulian >=[SearchBeginDateJ] AND dischargejulian <=[SearchEndDateJ]"
IfEx "[searchbegindateJ] = [#34][#34] and [SearchEndDateJ] <> [#34][#34]"
dbpQuery "checkin" "ds" "dischargejulian <=[SearchEndDateJ]"
IfEx "[searchbegindateJ] <> [#34][#34] and [SearchEndDateJ] = [#34][#34]"
dbpQuery "checkin" "ds" "dischargejulian >=[SearchBeginDateJ]"

It seems odd that the first preview request would show all records, then previewing again would show the query results. Anyone notice anything like this? Any insight would be helpful. Thanks.
Posts: 19
Joined: Mon Apr 07, 2008 1:43 pm

Postby Gaev » Sun Jun 22, 2008 12:49 pm


I suggest you first check out whether the dbfQuery commands are doing what they are supposed to do ... either with AlertBox commands within each IfEx/EndIf code block that display the value of the [checkin.ds.$RecCount] variable ... or by displaying the records grid inside a Rectangle object.
User avatar
Posts: 3750
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Neosoft Support » Mon Jun 23, 2008 11:01 am

When querying date fields you should surround the date with # characters. For example:

Code: Select all
dbpQuery "database id" "table" "datDate >= #[start_date]# and datDate <= #[end_date]#"


Code: Select all
dbpQuery "database id" "table" "datDate between #[start_date]# and #[end_date]#"

Without the # characters, the SQL engine processes the date as a mathematical formula. I don't know if this is a quirk of MS Access alone or also applies to other DBs.
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5620
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest