|
#1
|
|||
|
|||
|
Problem with SQL Select command
hi all,
can someone please help me I am having problems with this SQL Select command Code:
SQLCommand = SQLCommand & "WHERE JournalDate Between '" & FrmJournalRoll1.txtStartDate.Text & "' AND '" & FrmJournalRoll1.txtEndDate.Text & " AND PoSNumber='" & FrmJournalRoll1.txtPoS.Text & "'" BUT if I enter a wide date range say 01/09/2009 to 20/09/2009 it is finding dates from 01/01/2007 and 01/01/2009 can someone please point out where I am going wrong? Thanks |
|
#2
|
||||
|
||||
|
Database?
Date format?
__________________
HTH ![]() VBCorner code: MenuCreator add-in + MenuExtended.dll - SaveToFolder add-in - my PSC code: CommonDialog Enhanced Callback - Enumerate Icon Resources - Network Change TCP/IP |
|
#3
|
|||
|
|||
|
Database is SQL Server 2005 Express
date format is DD/MM/YYYY (eg 01/11/2009) |
|
#4
|
||||
|
||||
|
Show the whole SQLCommand string value ...
__________________
HTH ![]() VBCorner code: MenuCreator add-in + MenuExtended.dll - SaveToFolder add-in - my PSC code: CommonDialog Enhanced Callback - Enumerate Icon Resources - Network Change TCP/IP |
|
#5
|
|||
|
|||
|
SELECT * from JournalRoll WHERE JournalDate Between '01/09/2009' AND '20/09/2009' AND PoSNumber='001'
this is what is printed in the debug window Last edited by Drew_gable; 11-03-2009 at 11:09 AM. |
|
#6
|
||||
|
||||
|
Quote:
JournalDate is a String or Date field type?
__________________
HTH ![]() VBCorner code: MenuCreator add-in + MenuExtended.dll - SaveToFolder add-in - my PSC code: CommonDialog Enhanced Callback - Enumerate Icon Resources - Network Change TCP/IP |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| data environment SQL command | helme_syahiemie | VB Classic | 4 | 09-05-2007 04:11 PM |
| How do I find duplicate records? | Nancy | Database | 2 | 01-11-2002 10:38 PM |
| SELECT INTO..# performance in SQL 7.0 | David Miller | Database | 1 | 01-18-2001 06:33 PM |
| Re: Sort problem in MS SQL Server 7.0 | D. Patrick Hoerter | Database | 1 | 06-26-2000 05:57 PM |
| Urgent please... --- getting deadlock error..when using activex dll in VC++ | Chandra | VB Classic | 0 | 06-22-2000 08:30 AM |