navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

SQL Server/FP 2003 Query - Updated(part of the problem found)

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> SQL Server/FP 2003 Query - Updated(part of the problem found)
Page: [1]
 
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
SQL Server/FP 2003 Query - Updated(part of the problem ... - 2/16/2004 18:08:36   
What is the proper way to run a query against SQL Server that will pull between dates. I have the following query:
SELECT Sales_Managers.slsmgr, Format((Sum([RC]*6.5))+(Sum([NRC])),'$#,##0.00') AS NSR, Sum(Orders.Package) AS SumOfPackage, Sum(Orders.PCS) AS SumOfPCS, Sum(Orders.DSL) AS SumOfDSL, Sum(Orders.Narrowband) AS SumOfNarrowband, Sum(Orders.CPE) AS CPEquip, Sum(Orders.LD) AS SumOfLD FROM Orders INNER JOIN (Employees INNER JOIN Sales_Managers ON Employees.slsmgr = Sales_Managers.slsmgr) ON Orders.SalesCode = Employees.slscd WHERE (((Orders.AppDate) Between '::StartDate::' And '::EndDate::')) GROUP BY Sales_Managers.slsmgr HAVING (((Sales_Managers.slsmgr)='::slsmgr::'));

This query fails unless I pull the WHERE (((Orders.AppDate) Between '::StartDate::' And '::EndDate::')) clause out of the query. Please and thanks much all

Mike

< Message edited by mikeb -- 2/16/2004 19:06:36 >
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/16/2004 19:09:47   
What happens when you 'hard code' the where clause with actual dates?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mikeb)
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/16/2004 19:57:02   
No errors, works correctly

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/16/2004 22:35:38   
I think I read in one of your other posts, that this issue was when you first came to the page but was OK when submitting information?

Is that correct?

If so - you need to provide defaults at step 3 of the DRW for the empty entries, OR place the query form on a different page and POST it to the DRW page that is expecting the input.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mikeb)
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 13:42:02   
Different problem. I set it to debug and solved the defaults issue, was a different page as well. Problem now is I think in the way dates are being passed to the sql server. I can hard code the dates, and it works, but if I pass them by using a search form or posting to the page from another form, I get the error.

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 13:50:34   
What format date are you entering?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mikeb)
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 14:11:06   
Date formated 02/16/04 the parameter formated '::StartDate::'
Used to have them in the format #::StartDate::# but when we moved from Access to SQL Server, it would no longer accept it that way.
As a note. It works perfectly when I run a single date, but crashes and burns when I try to run a " between '::StartDate::' and '::EndDate::' "

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 14:22:22   
Does it also crash and burn if you use this date ?

2004/02/16

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mikeb)
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 14:26:37   
Yup,

Is it possible that Between is not valid for SQL Server?

Unable to find operator in query string. Query string currently is SELECT Sales_Managers.slsmgr, Employees.slscd, Employees.lname, Employees.fname, (Sum([RC]*6.5))+(Sum([NRC])) AS NSR, Orders.AppDate, Sum(Orders.Package) AS SumOfPackage, Sum(Orders.PCS) AS SumOfPCS, Sum(Orders.DSL) AS SumOfDSL, Sum(Orders.Narrowband) AS SumOfNarrowband, Sum(Orders.CPE) AS CPEquip, Sum(Orders.LD) AS SumOfLD FROM Orders INNER JOIN (Employees INNER JOIN Sales_Managers ON Employees.slsmgr = Sales_Managers.slsmgr) ON Orders.SalesCode = Employees.slscd WHERE (((Orders.AppDate) Between '::StartDate::' And '::EndDate::')) GROUP BY Sales_Managers.slsmgr, Employees.slscd, Employees.lname, Employees.fname, Orders.AppDate HAVING (((Sales_Managers.slsmgr)='::slsmgr::'));

BTW, really appreciate your time on this

< Message edited by mikeb -- 2/17/2004 14:28:26 >

(in reply to Spooky)
jdanderson02

 

Posts: 27
Joined: 2/17/2004
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 14:43:30   
All,

I had run in to this same problem when trying to implement someone's tutorial on using column headings as hyperlinks to sort database results. As an MSDN subscriber I contacted Microsoft about this and to make a long story short , their initial response was that there was a bug with FP 2003. Apparently the problem is with the way FP2003 generates the fpdbrgn1.inc file, according to Microsoft. Unfortunately I was subsequently told that MS has no plans to correct this problem as they blame the problem on the "click-back" step in the Database Results Wizard process used to create hyperlinks that sort as it is a misuse of FP (even though it works fine in FP2002). However, I have found that anytime I try to pass parameters (i.e. ::value::) in a query created with FP2003 that I have the same problem, it doesn't work.

The solution I received from MS was to uninstall FP2003 and use FP2002. If anyone would like to see the email thread please let me know. Or if anyone has been able to get this to work in FP2003 I'd like to find out how as I would prefer to use FP2003 but cannot until the problem is fixed or if there is a way around it. Thanks.

(in reply to mikeb)
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 14:54:43   
If you use FP2002, will it hose what has been done with fp2003? maybe a better solution is to hand code in asp, as much as I'd rather not for time constraints and learning curve... still learning asp/asp.net

(in reply to jdanderson02)
jdanderson02

 

Posts: 27
Joined: 2/17/2004
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/17/2004 16:54:55   
Mike - We had to start from scratch using FP2002. Basically we had to delete the fpdblib.inc file and any fpdbrgn*.inc files (both located in the _fpclass folder) and have FP2002 generate it's own version of these files in order to get any passed parameters to work.

(in reply to mikeb)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/18/2004 10:23:01   
Chalk up another error with the new includes then....
I mentioned using the old includes with the previous problem, however it looks like it will become the stock answer from now.... :)

Here are the 2000 versions if you need
http://www.frontpagewebmaster.com/m-182839/tm.htm

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to jdanderson02)
jdanderson02

 

Posts: 27
Joined: 2/17/2004
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/18/2004 16:28:00   
So, Spooky. Pardon my ignorance on this subject, but are you saying that I can use FP2003 and workaround the bug by simply replacing the includes generated by FP2003 with the includes contained in the zip file you pointed to? Grazie.

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/18/2004 19:04:10   
For a standard DRW, yes. (Keep backups! ;-)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to jdanderson02)
mikeb

 

Posts: 53
Joined: 10/15/2003
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/23/2004 13:34:08   
Ok, I'm using both versions of the include right now, depending on whether or not there is a date in the query, as I can't get the dates to pass correctly with the old version of the includes due to a character string conversion error that MSSQL server throws. The question I have is that everything is working correctly, but I'd like to be able to just completely remove the yellow error message boxes from being displayed on the page when I have no default values or when SQL server pukes on the Default tag that fp2003 includes cause. Is it possible to do this?

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: SQL Server/FP 2003 Query - Updated(part of the prob... - 2/23/2004 14:36:11   
When passing a query, pass it from a default form to the processing page. Dont submit the form from the same page as the DRW.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to mikeb)
Page:   [1]

All Forums >> Web Development >> General Web Development >> SQL Server/FP 2003 Query - Updated(part of the problem found)
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts