Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 19th, 2007, 11:34 PM
Registered User
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help needed - data from Excel sht where Date>= xx

I am trying to retrieve the number of records from an Excel spreadsheet that have a datefield value >= a given date from my VB 2005 Express application. However, I haven't been able to retrieve the correct number of records - it is either all or nothing. It seems to be a date formatting problem between Excel and VB?

The relevant code I am using is as follows:

strDate = FormatDateTime(dtpreviousday, DateFormat.ShortDate)

rsDataSQL = "Select * from ['CBS InTransit Report$'] WHERE (ETD>='" & strDate & "') AND (location='Complete')"
rsData.Open(rsdataSQL, cnxn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText)

dtpreviousday is the start of the current week (Sunday) and I want to retrieve the number of records that have an ETD of that date or later by using rsdata.recordcount on the resulting recordset.

I will be grateful for any help.

Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT >> Excel asearle XSLT 1 October 31st, 2006 12:07 PM
can someone help mi ? i m quite a newbie ..[xx(] g0dchild_85 ASP.NET 1.0 and 1.1 Basics 4 June 9th, 2006 12:59 PM
<xsl:for-each> and key() - help needed muchofrio XSLT 5 April 13th, 2006 09:28 AM
HELP Needed in Date Manipulation kunjan SQL Language 9 March 19th, 2006 09:51 PM
Dynamic Controls [xx(] koneruvijay VS.NET 2002/2003 0 November 12th, 2003 12:02 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.