|
-
Jun 11th, 2000, 08:22 PM
#1
Thread Starter
Addicted Member
I need to retrieve only the date part of the datetime field in my select statement. Is there a way to do this?
-
Jun 11th, 2000, 08:45 PM
#2
PowerPoster
Code:
Dim sql$
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
:
:
sql = "SELECT DateValue(MyDateTime) As DisplayDate FROM tblMyTable WHERE ....;"
Set Rs = Db.Openrecordset(sql,dbopenSnapshot)
-
Jun 11th, 2000, 09:04 PM
#3
Thread Starter
Addicted Member
Tried it but I got an error: 'DateValue' is not a recognized function name.
Here is my SQL statement that I'm trying to use. I want it to be grouped by the date but it keeps grouping by the datetime.
SHAPE{SELECT RefNo, RefPart, DateValue(Date) As Date, Author, Description, StyleID, Customer, GrandTotal, sOrderedQty = CASE Ordered WHEN '0' THEN '' ELSE CAST(OrderedQty AS CHAR) END, sOrdered = CASE Ordered(Date >= '5/11/2000 12:00:00 AM' AND Date <= '5/11/2000 11:59:59 PM') ORDER BY Date, RefNo, Author, Customer, GrandTotal} AS ReportChild COMPUTE ReportChild BY Date
Any suggestions?
-
Jun 11th, 2000, 09:50 PM
#4
Thread Starter
Addicted Member
GOT IT
I had to use CONVERT(Char, Date, 101) As Date in the SQL SELECT Statement
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
|