Posts

Showing posts with the label date

Create a custom date or time format

Image
  Select the cell or range of cells that you want to format. How to select a cell or a range On the Home tab, click the Dialog Box Launcher next to Number .  Tip    You can also press CTRL+1 to open the Format Cells dialog box. In the Category box, click Date or Time , and then choose the number format that is closest in style to the one you want to create. (When creating custom number formats, it's easier to start from an existing format than it is to start from scratch.) In the Category box, click Custom . In the Type box, you should see the format code matching the date or time format you selected in the step 3. The built-in date or time format can't be changed or deleted, so don't worry about overwriting it. In the Type box, make the necessary changes to the format. You can use any of the codes in the following tables: Days, months, and years      To display Use this code ...
Examples that use the current date in their criteria Top of Form To include items that ... Use this criteria Query result Contain today's date Date() Returns items with a date of today. If today's date is 2/2/2012, you’ll see items where the date field is set to Feb 2, 2012. Contain yesterday's date Date()-1 Returns items with yesterday’s date. If today's date is 2/2/2012, you’ll see items for Feb 1, 2012. Contain tomorrow's date Date() + 1 Returns items with tomorrow’s date. If today's date is Feb 2, 2012, you’ll see items for Feb 3, 2012. Contain dates within the current week DatePart("ww", [SalesDate]) = DatePart("ww", Date()) and Year( [SalesDate]) = Year(Date()) Returns items with dates during the current week. A week in Access starts on Sunday and ends on Saturday...