sql command in access to view particular date in a data

learning_grexcel

Active Member
Joined
Jan 29, 2011
Messages
319
I want to view a data in MS Access using SQL command. The data contains one column of "Date" as below
Date >> Company >> Purchased item
01.06.2011 >> A >> pen
01.06.2011 >> B >> rubber
02.06.2011 >> A >>> pencil
03.06.2011 >> A >> pencil

Now I want to view sale of only 1st June, how I can do that?

i tried the following
Select date, company, purchased item
From tablename
WHERE Date = 01.06.2011

But it doesn't show output.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Code:
Select date, company, [purchased item]
From tablename
WHERE Date = #01.06.2011#


1) put brackets around field names with spaces in them (or better, just don't use fields names with spaces in them)
2) put # symbols around literal dates
3) We assume that you do have true dates and not dates stored as text.
4) Date is not a good name for a field in Access as it is a reserved keyword in VBA for the DATE() function - obscure problems can arise when you use reserved words as the names of fields or tables.

Using the query design grid and then changing to SQL View is a good way to check your understanding of Access SQL syntax.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top