Using Data Manipulation Functions

S

SQL newbie

Can someone show me an example of how to retrieve a
result from a table using the DATEPART function by month
& also by day? Thank you
 
F

fredg

Can someone show me an example of how to retrieve a
result from a table using the DATEPART function by month
& also by day? Thank you

Why not give us an example date, the result you wish to receive, and
where you are doing this so that we can see if the DatePart function
is suitable for the purpose.

Other than that, you could look up the DatePart function in the VBA
help files yourself to see an example of it's use there.
Open any code window, or press Ctrl + G, and open the help files.
Type
DatePart
in the Index keyword box.
Read the available arguments and look at the example.
 
A

Albert D. Kallal

You can build a query to show all people with a birthday this month in the
query builder



FirstName lastName BirthDAte
BMonth:Month([BirthDate])



= 7


In the query builder, you can see how I put in a new collum, and called it
BMonth. If you view the query, you will that it simply returns the month. I
also in the example show that I put in a criteria of 7 (for this month).

You could also show people with a birthday TO day by adding a anther column
with the day function...


BDay:Day([BirthDate])


= 22

Today is July 22, and thus anyone with a birthday to day will show in the
query....

So, just add a few more collumns to the query, and you can then sleect by
month, or even day...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top