A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can I assign an active X calander to a query



 
 
Thread Tools Display Modes
  #31  
Old April 3rd, 2005, 05:02 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

Sounds as though you need to play with the fourth parameter that specifies
the first week of the year.

Acceptable values a

vbFirstJan1 (1) Start with week in which January 1 occurs
(default).
vbFirstFourDays (2) Start with the first week that has at least four days
in the new year.
vbFirstFullWeek (3) Start with first full week of the year.

WK: Format(DatePart("ww",[DATE],2,2)-1,"00") returns 14, but you might want
to test some other dates and with the other parameter values.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"cel504" wrote in message
...
Hi,

The date is entered as say 04/04/2005 and then datepart to give year
number
and datepart to give weeknumber. These are then merge and the output is
200515 and not 200514 as it should be.If I use the formula on the week to
be
WK: Format(DatePart("ww",[DATE],2)-1,"00") correct weekdate will be 14. I
would appreciate any help you can give me.

"Douglas J. Steele" wrote:

Not without knowing what date you're passing to get that value and how
you're calculating it...

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"cel504" wrote in message
...
That's great and I have mangaged to do that now, one other point, the
weeks
are out of sync by one, ie, 200505, should be 200504, any ideas on why.

"Douglas J. Steele" wrote:

Functions like DatePart and Format (both of which can be used to
calculate
week) have two optional arguments that let you specify the first day
of
the
week (use vbMonday, or 2 in your case) and . Check
the
Help file for details.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"cel504" wrote in message
news How can I set the work week to be Monday to Sunday, or even Sunday
to
Saturday?

Can anybody help please?


"cel504" wrote:

Can anyone help with this.
When I enter a date onto the database, I need to convert the date
to a
year
and week format. I have two problems.

The first is the year and week becomes say 20059, but I need it to
be
200509, how can I get the extra nought before the 9.
When I enter the date, the data baseconverts it ok, but is
currently 1
week
out of sync. ie, 07/02/05 convers to week 11 and not week
10......any
ideas
please.


"Rick Brandt" wrote:

cel504 wrote:
Does anybody know how to stop the screen from flickering when
switching between forms. I know in Excel the code is
Application.ScreenUpdating.False, I have tried using this in
Access
without success. Is there a way of closing one form, when
another
is
opened?

Application.Echo False
(do some stuff)
Application.Echo True

Make sure you include an error trap that also sets the Echo back
to
true or your
user could get stuck with an app that won't update the screen.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com











  #32  
Old April 14th, 2005, 09:29 PM
cel504
external usenet poster
 
Posts: n/a
Default

Can anyone help me with this formula in a query,

BASIC PAY: IIf([DAY]"SAT" Or "SUN",[PAID HRS] = 8,0) in my mind it looks
correct but it obviously it isn't. What is the correct way to use an "OR"
function.Any help would be gratefully appreciated.





Sounds as though you need to play with the fourth parameter that specifies
the first week of the year.

Acceptable values a

vbFirstJan1 (1) Start with week in which January 1 occurs
(default).
vbFirstFourDays (2) Start with the first week that has at least four days
in the new year.
vbFirstFullWeek (3) Start with first full week of the year.

WK: Format(DatePart("ww",[DATE],2,2)-1,"00") returns 14, but you might want
to test some other dates and with the other parameter values.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"cel504" wrote in message
...
Hi,

The date is entered as say 04/04/2005 and then datepart to give year
number
and datepart to give weeknumber. These are then merge and the output is
200515 and not 200514 as it should be.If I use the formula on the week to
be
WK: Format(DatePart("ww",[DATE],2)-1,"00") correct weekdate will be 14. I
would appreciate any help you can give me.

"Douglas J. Steele" wrote:

Not without knowing what date you're passing to get that value and how
you're calculating it...

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"cel504" wrote in message
...
That's great and I have mangaged to do that now, one other point, the
weeks
are out of sync by one, ie, 200505, should be 200504, any ideas on why.

"Douglas J. Steele" wrote:

Functions like DatePart and Format (both of which can be used to
calculate
week) have two optional arguments that let you specify the first day
of
the
week (use vbMonday, or 2 in your case) and . Check
the
Help file for details.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"cel504" wrote in message
news How can I set the work week to be Monday to Sunday, or even Sunday
to
Saturday?

Can anybody help please?


"cel504" wrote:

Can anyone help with this.
When I enter a date onto the database, I need to convert the date
to a
year
and week format. I have two problems.

The first is the year and week becomes say 20059, but I need it to
be
200509, how can I get the extra nought before the 9.
When I enter the date, the data baseconverts it ok, but is
currently 1
week
out of sync. ie, 07/02/05 convers to week 11 and not week
10......any
ideas
please.


"Rick Brandt" wrote:

cel504 wrote:
Does anybody know how to stop the screen from flickering when
switching between forms. I know in Excel the code is
Application.ScreenUpdating.False, I have tried using this in
Access
without success. Is there a way of closing one form, when
another
is
opened?

Application.Echo False
(do some stuff)
Application.Echo True

Make sure you include an error trap that also sets the Echo back
to
true or your
user could get stuck with an app that won't update the screen.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com












  #33  
Old April 14th, 2005, 09:47 PM
MGFoster
external usenet poster
 
Posts: n/a
Default

cel504 wrote:
Can anyone help me with this formula in a query,

BASIC PAY: IIf([DAY]"SAT" Or "SUN",[PAID HRS] = 8,0) in my mind it looks
correct but it obviously it isn't. What is the correct way to use an "OR"
function.Any help would be gratefully appreciated.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Like this:

Basic Pay: IIf([Day]"SAT" OR [Day]"SUN", 8, 0)

What are you trying to do, an UPDATE? Try the following to just change
the Paid Hrs for Mon-Fri days:

UPDATE table_name
SET [Paid Hrs] = 8
WHERE [Day] Not In ("Sat", "Sun")

Or, for all days in one go:

UPDATE table_name
SET [Paid Hrs] = IIf([Day] Not In ("Sat","Sun"), 8, 0)

--
MGFoster:::mgf00 at earthlink decimal-point net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQl7WzoechKqOuFEgEQJyWQCeM1zvwKpQxFJeD7nvlObsMa ZBdPYAnixO
9qCc+SlfhYAuC1O8MT7OkcJg
=W4VP
-----END PGP SIGNATURE-----
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to assign passthrough query into listbox rowsource Sunny New Users 1 January 10th, 2005 09:09 PM
Inactive delete feature frepaci Using Forms 7 October 27th, 2004 08:11 PM
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM
Too Few Parameters error Mail Merge Access Parameter Query Tony_VBACoder Mailmerge 3 September 14th, 2004 12:15 PM
Display Parameter from Form on Report sara Setting Up & Running Reports 10 July 19th, 2004 04:54 PM


All times are GMT +1. The time now is 08:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.