Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2005

Tip: Looking for answers? Try searching our database.

Extracting the year part from createdatetime field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack - 04 Aug 2005 19:02 GMT
Hi,
I got a table where the createdatetime field creates a date and time stamp
for each of record creation. I need to pull all the records for the year
2004. In the criteria for the createdatetime field, if I write
DatePart("yyyy", CreateDateTime) = 2004, no data pulls from the database. I
am wondering where I am going wrong. I appreciate any help. Regards.
Ron Weiner - 04 Aug 2005 23:40 GMT
Jack

If the Column CreateDateTime is a Date/Time data type and your expression
is:
WHERE DatePart("yyyy",CreateDateTime)=2004
Then my guess is that there are no rows in the table that have a 2004 date.
If you think that there are dates with 2004 years in them in the
CreateDateTime column you might want to double check the column type again.

Ron W
www.WorksRite.com

> Hi,
> I got a table where the createdatetime field creates a date and time stamp
> for each of record creation. I need to pull all the records for the year
> 2004. In the criteria for the createdatetime field, if I write
> DatePart("yyyy", CreateDateTime) = 2004, no data pulls from the database. I
> am wondering where I am going wrong. I appreciate any help. Regards.
KARL DEWEY - 05 Aug 2005 00:26 GMT
In query design view grid add in the Field row --
X:DatePart("yyyy",CreateDateTime)
In the criteria row under the above field use --
[Enter your year (2003)]
Uncheck the Show box.

> Jack
>
[quoted text clipped - 15 lines]
> I
> > am wondering where I am going wrong. I appreciate any help. Regards.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.