Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Stored Procedure
Message
De
26/07/2010 16:34:22
 
 
À
26/07/2010 13:38:50
Andy Roth
Neyenesch Printers
Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01473624
Message ID:
01473984
Vues:
50
>>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform