Solved

Set sql statement for Date

Posted on 1998-08-19
4
146 Views
Last Modified: 2010-04-30
Is there any way to 'select' all record with particular date value, without specifying the time value ?

I have tried with the following command :

Select * from db1 where mydate like "12/11/1998"

but it always fails (no result return). I guess it's because I didn't use the complet date format, including the time portion.

For examples : I want to list all records with date value "1 january 98", how the sql statement should be ?
0
Comment
Question by:asiasoft
  • 2
4 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1429817
You have to include the dates between #.

Select * from db1 where mydate = #12/11/1998#
0
 

Author Comment

by:asiasoft
ID: 1429818
Sorry Waty, I have tried that way and still not working.

thanks

0
 
LVL 4

Accepted Solution

by:
mcix earned 50 total points
ID: 1429819
SELECT * from DB1
WHERE
mydate Between #1/1/98# And #1/1/98 11:59:00 PM#
0
 

Author Comment

by:asiasoft
ID: 1429820
Well, actually I hope there would be simpler way than that way. Anyway, thanks for the answer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question