|
-
Dec 30th, 2002, 01:19 AM
#1
Thread Starter
Lively Member
Sql Statement
I have a table with Column "DateIn" and "DateOut". I want to use a Sql statement to filter out all Rows which DateOut is Empty.
So..i Use a statement
Try
OutSearchIDAdapter1.SelectCommand.CommandText = _
"SELECT PaperRollID FROM PaperRollTransaction WHERE " & _
"DateOut = '""' " & _
"ORDER BY PaperRollID ASC"
OutSearchIDAdapter1.Fill(OutSearchIDDataSet11)
Catch oledbdataexception As System.Data.OleDb.OleDbException
MessageBox.Show(oledbdataexception.Message)
End Try
The above statement is giving me an error message. I know that my Sql statement has error in WHERE clause. So..just wonder how do i filter out the Empty Column in Access Table.
-
Dec 30th, 2002, 03:07 AM
#2
Registered User
Try...
"SELECT PaperRollID FROM PaperRollTransaction WHERE " & _
"DateOut Is Null " & _
"ORDER BY PaperRollID ASC"
-
Dec 31st, 2002, 12:54 AM
#3
Thread Starter
Lively Member
Thanks, but another problem
I got it!, anywhere thanks.
I have another question, Example, i have many date values inside the table; 11/23/2002, 11/24/2002, 11/25/2002, 12/12/2002, 12/14/2002, 12/25/2002. how to i just filter out records on monthly basic?
For Instance, I wan the records on Dec / 2002.
-
Dec 31st, 2002, 02:08 AM
#4
Addicted Member
hi maybe you could try this:
Select from tablename where date>= '"& 12/1/2002 & "'and Date <= '" & 12/31/2002 & "'"
-
Dec 31st, 2002, 02:53 AM
#5
Thread Starter
Lively Member
Commie..Thanks, but this is not what i want
i wan to do it in a flexible way, i would have 2 text/combo box to select MONTH and YEAR, respectively.
-
Dec 31st, 2002, 03:44 AM
#6
Addicted Member
In that case you could try doing this
Select from tablename where date= '"& comboboxmonth.text &"/1/"& comboboxYear.text &"'"
-
Dec 31st, 2002, 08:24 PM
#7
Thread Starter
Lively Member
Why /1/ ?
Will it filter out only 1/1, 2/1, 3/1 ... 12/1??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|