Rabu, 04 November 2015

Re: [MS_AccessPros] Set the format of table date field to Month only

 

Kevin-


Yes, but like this if you're using it in a query:  Month([CheckInDate])

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Nov 4, 2015, at 1:27 PM, 'zhaoliqingoffice@163.com' zhaoliqingoffice@163.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John-
What if it's date field? e.g. CheckinDate? Is this ok?
?Month(CheckinDate)
Kevin


 
Date: 2015-11-04 19:59
Subject: Re: [MS_AccessPros] Set the format of table date field to Month only
 

Kevin-


Use the Month function.

?Month(#2015-11-20#)
11


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Nov 4, 2015, at 12:23 PM, zhaoliqingoffice zhaoliqingoffice@163.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John-
I see. Then if I want to compare this month field with a date field, I have to convert a date field to a number, right?  e.g. how to convert 20-Nov-2015 to number 11? Thanks,
Kevin



在 "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2015年11月4日 下午6:57写道:

 

Kevin-


If you use a date/time field, then you must store either a full date (year, month, day) or a time (hh:mm:ss) or both.  Why not use an integer field for the month number or a text field for the month name?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Nov 4, 2015, at 11:33 AM, 'zhaoliqingoffice@163.com' zhaoliqingoffice@163.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Dear All,
I am designing a table with a date field. I want have this field in month only format. Is that possible?   Here's the table:

tblCityHotelRate
CityHotelRateID (key)
CityID
CithHotelRateMonth (I want to format this field in month only)
CityHotelStarID
CityHotelRoomTypeID
CityHotelRate

Best Regards,
Kevin








__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

.

__,_._,___

Tidak ada komentar:

Posting Komentar