Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Comparing part of Date in ACCESS Database

Author  Topic 

azamsharp
Posting Yak Master

201 Posts

Posted - 2005-08-06 : 21:51:23
Hi,

In my database I have date as string format which is something like this:

2/3/2005

Now the user selects month and the year and I want to compare in the ACCESS database for that search I make the search string something like this

3/2005

but offcourse it does not match since the date in the database contains the day also any work around for this problem.

Mohammad Azam
www.azamsharp.net

kapilarya
Yak Posting Veteran

86 Posts

Posted - 2005-08-07 : 03:41:20
use 'LIKE' operator for your search criteria

Kapil Arya
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-08-07 : 13:08:18
If your question is about Access, you should post it in the MS Access Forum.

The Transact-SQL Forum is for questions about MS SQL Server Transact-SQL.






CODO ERGO SUM
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-08 : 01:31:15
If you compare those from getting the values from controls, then

Con.Execute("Select columns from yourtable
where month(datecol)= " & monthcontrol.text & " and year(datecol)=" & yearcontrol.text & "")

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -