Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 6 Sql Question using dates
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP3
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00953528
Message ID:
00953772
Views:
16
>Tom,
>
>MS SQL Server doesn't have date data type, only datetime. You've to either convert datetime from cursor into date or date from the textbox to the datetime.
ldDate = Thisform.cntStartDate.txtDate.Value
>* Date to DatetTime
>ltDateTime = DTOT(ldDate+1) - 1
>...
>AND cuDetail.CreatedDate <= ldDateTime
>
>* DatetTime to Date
>...
>AND TTOD(cuDetail.CreatedDate) <= ldDate
>
Sergey;

Thanks more than a MILLION!

Here is what I ended up with thanks to your suggestion:
ldDate = Thisform.cntStartDate.txtDate.Value

ldDate = CTOD(ldDate)

ltDateTime = DTOT(ldDate+1) – 1

Select cuDetail.PartNumber, cuDetail.ReworkNumber, cuDetail.Kanban, ; 
	SUM(cuDetail.TotalOK) AS CtTotal, SUM(cuDetail.OK) AS CtOK, ;
	SUM(cuDetail.Reworked) AS CtReworked, SUM(cuDetail.Rejected) AS CtRejected ;
	from cuReworkNumber, cuDetail ;
	WHERE cuReworknumber.ReworkNumber = cuDetail.ReworkNumber ;
	AND cuDetail.CreatedDate <= ltDateTime ;
	GROUP BY cuDetail.ReworkNumber, cuDetail.PartNumber ;
	into cursor cuCumulativeTotal ;
	ORDER BY cuDetail.ReworkNumber, cuDetail.PartNumber
I have to go to a meeting to discuss the launch of my two applications that are associated with each other. The written request to launch is scheduled for Monday and it takes five business days for a request to be processed. One application is in ASP – has over 170 forms, 200,000 lines of code and is a monster! The other is a VFP report Application that pulls data from SQL Server which now is complete thanks to you!

By the way I have been at this job for almost five years. I was hired for my VFP skills but when I came to work I was not allowed to use VFP. This is the first time our plant will use VFP! I am stuck with version 6.0 and now I can talk them into upgrading to Version 9! Nothing happens fast around here so I know version 9 will be released before the P.O. is signed off! :)

Thank you again! :)

Tom - Very happy in Silicon Valley (for a change!)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform