Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Stored Procedure
Message
From
26/07/2010 16:34:22
 
 
To
26/07/2010 13:38:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01473624
Message ID:
01473984
Views:
49
>>>>I am not sure I understand. A date would be passed as a datetime parameter. Internally a date like 1/1/2000 is considered to be a datetime value of 1/1/2000 00:00:00 (or 12:00:00 AM).
>>>>Cetin
>>>
>>>Correct but i in the database the end date was greater than 1/1/2000 00:00:00 (or 12:00:00 AM).
>>>say 1/1/2000 10:00:00 it would not be in the report
>>>
>>>the query uses invdate between startdate and end date 01/01/2000 10:00:00 is greater than 1/1/2000 00:00:00
>>>and would not be in the results
>>>
>>>but if it was al just date it would be
>>
>>I seem to recall having a similar problem. I was not using a stored procedure and got the data via SPT. The query was something like
>>SQLEXEC(nHandle,"SELECT * FROM myTable WHERE DATE(datetimeField) BETWEEN ?ldStartDate AND ?ldEndDate)
>>
>>Would it be possible to modify the SP to do something like that?
>no stored procedure to large.
>thanks

I'm not sure what you mean by Stored Procedure too large. Do you mean that you can't edit it or that you don't want to pull down the entire table. If the second, that's not at all what I meant. My suggestion is to change your SP from
SELECT fieldlist
FROM table and joins
WHERE
( bbjthead.closedate between @ldstartdate and @ldenddate
AND arjobhd.invdate IS NOT NULL
AND bbjthead.closedate >= arjobhd.invdate )
OR
( arjobhd.invdate between @ldstartdate and @ldenddate
etc


to
SELECT fieldlist
FROM table and joins
WHERE
( bbjthead.closedate between @ldstartdate and @ldenddate
AND arjobhd.invdate IS NOT NULL
AND bbjthead.closedate >= arjobhd.invdate )
OR
( DATE(arjobhd.invdate) between DATE(@ldstartdate) and DATE(@ldenddate)
etc
Previous
Reply
Map
View

Click here to load this message in the networking platform