Get Random Date to return per record in Query

Query

SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
AS DateOne
FROM tblStaff
GROUP BY tblStaff.StaffName;

Module

Public Function RandomDateInRange(LowerDate As Date, UpperDate As
Date) As Date
Randomize
RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
End Function

Currently this query returns a random date, however it is the same one
for the entire query. How can I get the each record in the query to
have a seperate random date?

I am trying to generate a random date for each staff member for QA
purposes.

Thanks,
David

0
gumby
4/5/2007 8:58:02 PM
access.queries 6343 articles. 1 followers. Follow

11 Replies
1048 Views

Similar Articles

[PageSpeed] 9

On 5 Apr 2007 13:58:02 -0700, "gumby" <david.isaacks@va.gov> wrote:

>Query
>
>SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
>AS DateOne
>FROM tblStaff
>GROUP BY tblStaff.StaffName;
>
>Module
>
>Public Function RandomDateInRange(LowerDate As Date, UpperDate As
>Date) As Date
>Randomize
>RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
>End Function
>
>Currently this query returns a random date, however it is the same one
>for the entire query. How can I get the each record in the query to
>have a seperate random date?
>
>I am trying to generate a random date for each staff member for QA
>purposes.
>
>Thanks,
>David

Unless you pass the function an argument referencing a table field, Access
will "save time" by calling the function only once and reusing the result. The
function doesn't need to *do* anything with the passed value, it just needs to
be in the argument list. For instance:

SELECT tblStaff.StaffName,
RandomDateInRange(#1/1/2001#,#12/31/2001#,[StaffName])
AS DateOne
FROM tblStaff
GROUP BY tblStaff.StaffName;

Public Function RandomDateInRange(LowerDate As Date, _
          UpperDate As Date, _
          vIgnore As Variant) As Date
Static bRandomize As Boolean
If bRandomize = False Then
    Randomize
    bRandomize = True
End If
RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
End Function

I'd also suggest just randomizing once per Access session. as noted in the
code.

Just to be more of a purist about not mixing datatypes, you might want to
consider:

RandomDateInRange = DateAdd("d", Int((UpperDate - LowerDate + 1) * Rnd),
LowerDate)

             John W. Vinson [MVP]
0
John
4/5/2007 11:21:14 PM
gumby wrote:

>Query
>
>SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
>AS DateOne
>FROM tblStaff
>GROUP BY tblStaff.StaffName;
>
>Module
>
>Public Function RandomDateInRange(LowerDate As Date, UpperDate As
>Date) As Date
>Randomize
>RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
>End Function
>
>Currently this query returns a random date, however it is the same one
>for the entire query. How can I get the each record in the query to
>have a seperate random date?


The problem is that
RandomDateInRange(#1/1/2001#,#12/31/2001#)
is the same for all records so Access/Jet only needs to
evaluate it once.

Add another argument to the function:

Public Function RandomDateInRange(LowerDate As Date,
UpperDate As Date, junk As Variant) As Date

And call it with a field in the extra argument:
RandomDateInRange(#1/1/2001#, #12/31/2001#, StaffName)
to make Access/Jet think the function can be different for
different records.

-- 
Marsh
MVP [MS Access]
0
Marshall
4/5/2007 11:35:54 PM
On Apr 5, 6:21 pm, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>
wrote:
> On 5 Apr 2007 13:58:02 -0700, "gumby" <david.isaa...@va.gov> wrote:
>
>
>
>
>
> >Query
>
> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >AS DateOne
> >FROM tblStaff
> >GROUP BY tblStaff.StaffName;
>
> >Module
>
> >Public Function RandomDateInRange(LowerDate As Date, UpperDate As
> >Date) As Date
> >Randomize
> >RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
> >End Function
>
> >Currently this query returns a random date, however it is the same one
> >for the entire query. How can I get the each record in the query to
> >have a seperate random date?
>
> >I am trying to generate a random date for each staff member for QA
> >purposes.
>
> >Thanks,
> >David
>
> Unless you pass the function an argument referencing a table field, Access
> will "save time" by calling the function only once and reusing the result. The
> function doesn't need to *do* anything with the passed value, it just needs to
> be in the argument list. For instance:
>
> SELECT tblStaff.StaffName,
> RandomDateInRange(#1/1/2001#,#12/31/2001#,[StaffName])
> AS DateOne
> FROM tblStaff
> GROUP BY tblStaff.StaffName;
>
> Public Function RandomDateInRange(LowerDate As Date, _
>           UpperDate As Date, _
>           vIgnore As Variant) As Date
> Static bRandomize As Boolean
> If bRandomize = False Then
>     Randomize
>     bRandomize = True
> End If
> RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
> End Function
>
> I'd also suggest just randomizing once per Access session. as noted in the
> code.
>
> Just to be more of a purist about not mixing datatypes, you might want to
> consider:
>
> RandomDateInRange = DateAdd("d", Int((UpperDate - LowerDate + 1) * Rnd),
> LowerDate)
>
>              John W. Vinson [MVP]- Hide quoted text -
>
> - Show quoted text -

Thank you, Works great.

0
gumby
4/6/2007 1:25:53 PM
On Apr 5, 6:35 pm, Marshall Barton <marshbar...@wowway.com> wrote:
> gumby wrote:
> >Query
>
> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >AS DateOne
> >FROM tblStaff
> >GROUP BY tblStaff.StaffName;
>
> >Module
>
> >Public Function RandomDateInRange(LowerDate AsDate, UpperDate As
> >Date) AsDate
> >Randomize
> >RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
> >End Function
>
> >Currently this query returns arandomdate, however it is the same one
> >for the entire query. How can I get the eachrecordin the query to
> >have a seperaterandomdate?
>
> The problem is that
> RandomDateInRange(#1/1/2001#,#12/31/2001#)
> is the same for all records so Access/Jet only needs to
> evaluate it once.
>
> Add another argument to the function:
>
> Public Function RandomDateInRange(LowerDate AsDate,
> UpperDate AsDate, junk As Variant) AsDate
>
> And call it with a field in the extra argument:
> RandomDateInRange(#1/1/2001#, #12/31/2001#, StaffName)
> to make Access/Jet think the function can be different for
> different records.
>
> --
> Marsh
> MVP [MS Access]- Hide quoted text -
>
> - Show quoted text -

Is their anyway to get this to ignore weekends (Sat & Sun)?

Thanks,
David

0
gumby
4/6/2007 2:19:12 PM
gumby wrote:

>On Apr 5, 6:35 pm, Marshall Barton <marshbar...@wowway.com> wrote:
>> gumby wrote:
>> >Query
>>
>> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
>> >AS DateOne
>> >FROM tblStaff
>> >GROUP BY tblStaff.StaffName;
>>
>> >Module
>>
>> >Public Function RandomDateInRange(LowerDate AsDate, UpperDate As
>> >Date) AsDate
>> >Randomize
>> >RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
>> >End Function
>>
>> >Currently this query returns arandomdate, however it is the same one
>> >for the entire query. How can I get the eachrecordin the query to
>> >have a seperaterandomdate?
>>
>> The problem is that
>> RandomDateInRange(#1/1/2001#,#12/31/2001#)
>> is the same for all records so Access/Jet only needs to
>> evaluate it once.
>>
>> Add another argument to the function:
>>
>> Public Function RandomDateInRange(LowerDate AsDate,
>> UpperDate AsDate, junk As Variant) AsDate
>>
>> And call it with a field in the extra argument:
>> RandomDateInRange(#1/1/2001#, #12/31/2001#, StaffName)
>> to make Access/Jet think the function can be different for
>> different records.
>>
>
>Is their anyway to get this to ignore weekends (Sat & Sun)?


Public Function RandomDateInRange( _
												LowerDate AsDate, _
												UpperDate AsDate, _
												junk As Variant _
												) AsDate
Static Initialized As Boolean
Dim dt As Date

	If Not Initialized Then 	Randomize : Initialized = True

	Do
		dt = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
	Loop Until DatePart("w", dt, vbMonday) < vbSaturday
	
	RandomDateInRange = dt
End Function

-- 
Marsh
MVP [MS Access]
0
Marshall
4/6/2007 4:53:01 PM
On Apr 6, 11:53 am, Marshall Barton <marshbar...@wowway.com> wrote:
> gumby wrote:
> >On Apr 5, 6:35 pm, Marshall Barton <marshbar...@wowway.com> wrote:
> >> gumby wrote:
> >> >Query
>
> >> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >> >AS DateOne
> >> >FROM tblStaff
> >> >GROUP BY tblStaff.StaffName;
>
> >> >Module
>
> >> >Public Function RandomDateInRange(LowerDate AsDate, UpperDate As
> >> >Date) AsDate
> >> >Randomize
> >> >RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
> >> >End Function
>
> >> >Currently this query returns arandomdate, however it is the same one
> >> >for the entire query. How can I get the eachrecordin the query to
> >> >have a seperaterandomdate?
>
> >> The problem is that
> >> RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >> is the same for all records so Access/Jet only needs to
> >> evaluate it once.
>
> >> Add another argument to the function:
>
> >> Public Function RandomDateInRange(LowerDate AsDate,
> >> UpperDate AsDate, junk As Variant) AsDate
>
> >> And call it with a field in the extra argument:
> >> RandomDateInRange(#1/1/2001#, #12/31/2001#, StaffName)
> >> to make Access/Jet think the function can be different for
> >> different records.
>
> >Is their anyway to get this to ignore weekends (Sat & Sun)?
>
> Public Function RandomDateInRange( _
>                                                                                                 LowerDate AsDate, _
>                                                                                                 UpperDate AsDate, _
>                                                                                                 junk As Variant _
>                                                                                                 ) AsDate
> Static Initialized As Boolean
> Dim dt As Date
>
>         If Not Initialized Then         Randomize : Initialized = True
>
>         Do
>                 dt = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
>         Loop Until DatePart("w", dt, vbMonday) < vbSaturday
>
>         RandomDateInRange = dt
> End Function
>
> --
> Marsh
> MVP [MS Access]- Hide quoted text -
>
> - Show quoted text -

Thank you, it works great.I did have to change to vbFriday because it
keep generating some Saturdays.

David

0
gumby
4/6/2007 6:34:38 PM
gumby wrote:

>On Apr 6, 11:53 am, Marshall Barton <marshbar...@wowway.com> wrote:
>> gumby wrote:
>> >On Apr 5, 6:35 pm, Marshall Barton <marshbar...@wowway.com> wrote:
>> >> gumby wrote:
>> >> >Query
>>
>> >> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
>> >> >AS DateOne
>> >> >FROM tblStaff
>> >> >GROUP BY tblStaff.StaffName;
>>
>> >> >Module
>>
>> >> >Public Function RandomDateInRange(LowerDate AsDate, UpperDate As
>> >> >Date) AsDate
>> >> >Randomize
>> >> >RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
>> >> >End Function
>>
>> >> >Currently this query returns arandomdate, however it is the same one
>> >> >for the entire query. How can I get the eachrecordin the query to
>> >> >have a seperaterandomdate?
>>
>> >> The problem is that
>> >> RandomDateInRange(#1/1/2001#,#12/31/2001#)
>> >> is the same for all records so Access/Jet only needs to
>> >> evaluate it once.
>>
>> >> Add another argument to the function:
>>
>> >> Public Function RandomDateInRange(LowerDate AsDate,
>> >> UpperDate AsDate, junk As Variant) AsDate
>>
>> >> And call it with a field in the extra argument:
>> >> RandomDateInRange(#1/1/2001#, #12/31/2001#, StaffName)
>> >> to make Access/Jet think the function can be different for
>> >> different records.
>>
>> >Is their anyway to get this to ignore weekends (Sat & Sun)?
>>
>> Public Function RandomDateInRange( _
>>                                                                                                 LowerDate AsDate, _
>>                                                                                                 UpperDate AsDate, _
>>                                                                                                 junk As Variant _
>>                                                                                                 ) AsDate
>> Static Initialized As Boolean
>> Dim dt As Date
>>
>>         If Not Initialized Then         Randomize : Initialized = True
>>
>>         Do
>>                 dt = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
>>         Loop Until DatePart("w", dt, vbMonday) < vbSaturday
>>
>>         RandomDateInRange = dt
>> End Function
>>
>>
>> - Show quoted text -
>
>Thank you, it works great.I did have to change to vbFriday because it
>keep generating some Saturdays.


Arrggghhh,  you're right.  At the last minute, I changed the
6 I originally had to vbSaturday.  Since vbSaturday has the
value 7, it was clearly an incorrect change.  Just to make
the code less confusing, I suggest that instead of vbFriday,
you use either 6 or vbSaturday-1

Sorry about the confusion.

-- 
Marsh
MVP [MS Access]
0
Marshall
4/6/2007 8:39:38 PM
On Apr 6, 3:39 pm, Marshall Barton <marshbar...@wowway.com> wrote:
> gumby wrote:
> >On Apr 6, 11:53 am, Marshall Barton <marshbar...@wowway.com> wrote:
> >> gumby wrote:
> >> >On Apr 5, 6:35 pm, Marshall Barton <marshbar...@wowway.com> wrote:
> >> >> gumby wrote:
> >> >> >Query
>
> >> >> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >> >> >AS DateOne
> >> >> >FROM tblStaff
> >> >> >GROUP BY tblStaff.StaffName;
>
> >> >> >Module
>
> >> >> >Public Function RandomDateInRange(LowerDate AsDate, UpperDate As
> >> >> >Date) AsDate
> >> >> >Randomize
> >> >> >RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
> >> >> >End Function
>
> >> >> >Currently this query returns arandomdate, however it is the same one
> >> >> >for the entire query. How can I get the eachrecordin the query to
> >> >> >have a seperaterandomdate?
>
> >> >> The problem is that
> >> >> RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >> >> is the same for all records so Access/Jet only needs to
> >> >> evaluate it once.
>
> >> >> Add another argument to the function:
>
> >> >> Public Function RandomDateInRange(LowerDate AsDate,
> >> >> UpperDate AsDate, junk As Variant) AsDate
>
> >> >> And call it with a field in the extra argument:
> >> >> RandomDateInRange(#1/1/2001#, #12/31/2001#, StaffName)
> >> >> to make Access/Jet think the function can be different for
> >> >> different records.
>
> >> >Is their anyway to get this to ignore weekends (Sat & Sun)?
>
> >> Public Function RandomDateInRange( _
> >>                                                                                                 LowerDate AsDate, _
> >>                                                                                                 UpperDate AsDate, _
> >>                                                                                                 junk As Variant _
> >>                                                                                                 ) AsDate
> >> Static Initialized As Boolean
> >> Dim dt As Date
>
> >>         If Not Initialized Then         Randomize : Initialized = True
>
> >>         Do
> >>                 dt = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
> >>         Loop Until DatePart("w", dt, vbMonday) < vbSaturday
>
> >>         RandomDateInRange = dt
> >> End Function
>
> >> - Show quoted text -
>
> >Thank you, it works great.I did have to change to vbFriday because it
> >keep generating some Saturdays.
>
> Arrggghhh,  you're right.  At the last minute, I changed the
> 6 I originally had to vbSaturday.  Since vbSaturday has the
> value 7, it was clearly an incorrect change.  Just to make
> the code less confusing, I suggest that instead of vbFriday,
> you use either 6 or vbSaturday-1
>
> Sorry about the confusion.
>
> --
> Marsh
> MVP [MS Access]- Hide quoted text -
>
> - Show quoted text -

Would it be possible to pick a month and have the query return two
random dates from each week? What about ensuring the two random dates
are never the same?

0
gumby
5/3/2007 5:15:16 PM
gumby wrote:
>> >> >> gumby wrote:
>> >> >> >Query
>>
>> >> >> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
>> >> >> >AS DateOne
>> >> >> >FROM tblStaff
>> >> >> >GROUP BY tblStaff.StaffName;
>
>Would it be possible to pick a month and have the query return two
>random dates from each week? What about ensuring the two random dates
>are never the same?


Since a function can return only one value for one record,
that would get pretty tricky.

First, you would need a record for each date.  This can be
done by creating a table (named Numbers) with one field
(named Num) and populating itsrecords with 1, 2, 3, ... up
to more than you will ever want.
Then your query would use a cross product Join something
like:

SELECT StaffName, 
		RandomDateInRange(#1/1/2001#,#12/31/2001#, Num)
							AS DateOne
		Num
FROM tblStaff, Numbers
WHERE Num <= 8

Then you will need to modify the function ti use the 3rd
argument to determine the week.

I don't have time to try to work it all out for you now and
I will be unavailable until Monday or Tuesday so see how far
you can get in the meantime.  Post back sometime Monday with
what you've got and what's blocking you.

-- 
Marsh
MVP [MS Access]
0
Marshall
5/3/2007 8:10:06 PM
On May 3, 3:10 pm, Marshall Barton <marshbar...@wowway.com> wrote:
> gumby wrote:
> >> >> >> gumby wrote:
> >> >> >> >Query
>
> >> >> >> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
> >> >> >> >AS DateOne
> >> >> >> >FROM tblStaff
> >> >> >> >GROUP BY tblStaff.StaffName;
>
> >Would it be possible to pick a month and have the query return two
> >random dates from each week? What about ensuring the two random dates
> >are never the same?
>
> Since a function can return only one value for one record,
> that would get pretty tricky.
>
> First, you would need a record for each date.  This can be
> done by creating a table (named Numbers) with one field
> (named Num) and populating itsrecords with 1, 2, 3, ... up
> to more than you will ever want.
> Then your query would use a cross product Join something
> like:
>
> SELECT StaffName,
>                 RandomDateInRange(#1/1/2001#,#12/31/2001#, Num)
>                                                         AS DateOne
>                 Num
> FROM tblStaff, Numbers
> WHERE Num <= 8
>
> Then you will need to modify the function ti use the 3rd
> argument to determine the week.
>
> I don't have time to try to work it all out for you now and
> I will be unavailable until Monday or Tuesday so see how far
> you can get in the meantime.  Post back sometime Monday with
> what you've got and what's blocking you.
>
> --
> Marsh
> MVP [MS Access]


Marsh,

Sorry I was out all last week and the week before. I setup the table
and messed with the query for a little while. I keep getting errors
about type mismatch or mispelled.

I am not sure what a cross product join query is.

David

0
gumby
5/17/2007 6:51:37 PM
On May 17, 1:51 pm, gumby <david.isaa...@va.gov> wrote:
> On May 3, 3:10 pm, Marshall Barton <marshbar...@wowway.com> wrote:
>
>
>
>
>
> > gumby wrote:
> > >> >> >> gumby wrote:
> > >> >> >> >Query
>
> > >> >> >> >SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
> > >> >> >> >AS DateOne
> > >> >> >> >FROM tblStaff
> > >> >> >> >GROUP BY tblStaff.StaffName;
>
> > >Would it be possible to pick a month and have the query return two
> > >random dates from each week? What about ensuring the two random dates
> > >are never the same?
>
> > Since a function can return only one value for one record,
> > that would get pretty tricky.
>
> > First, you would need a record for each date.  This can be
> > done by creating a table (named Numbers) with one field
> > (named Num) and populating itsrecords with 1, 2, 3, ... up
> > to more than you will ever want.
> > Then your query would use a cross product Join something
> > like:
>
> > SELECT StaffName,
> >                 RandomDateInRange(#1/1/2001#,#12/31/2001#, Num)
> >                                                         AS DateOne
> >                 Num
> > FROM tblStaff, Numbers
> > WHERE Num <= 8
>
> > Then you will need to modify the function ti use the 3rd
> > argument to determine the week.
>
> > I don't have time to try to work it all out for you now and
> > I will be unavailable until Monday or Tuesday so see how far
> > you can get in the meantime.  Post back sometime Monday with
> > what you've got and what's blocking you.
>
> > --
> > Marsh
> > MVP [MS Access]
>
> Marsh,
>
> Sorry I was out all last week and the week before. I setup the table
> and messed with the query for a little while. I keep getting errors
> about type mismatch or mispelled.
>
> I am not sure what a cross product join query is.
>
> David- Hide quoted text -
>
> - Show quoted text -

Marsh,

Ok, I think I got the query to work.

SELECT qryStaffName.StaffName, Numbers.Num,
RandomDateInRange(#1/1/2001#,#12/31/2001#,[Num]) AS [Date]
FROM qryStaffName, Numbers
WHERE (((Numbers.Num)<=8));

Not sure how to change the function.

Public Function RandomDateInRange(LowerDate As Date, UpperDate As
Date, junk As Variant) As Date
Static Initialized As Boolean
Dim dt As Date
If Not Initialized Then Randomize: Initialized = True
Do
dt = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
Loop Until DatePart("w", dt, vbMonday) < vbFriday
RandomDateInRange = dt
End Function
David

0
gumby
5/17/2007 7:07:13 PM
Reply:

Similar Artilces:

INDIRECT function returns a zero instead of a blank
Hi, I'm using the INDIRECT function to allow me to plot a series that spans several worksheets, as suggested here: http://peltiertech.com/Excel/ChartsHowTo/ChartFromDiffSheets.html My problem is that whereas some values are actually zero, others are blank; INDIRECT displays both as zero values. Is there a way to prevent this from happening? You could have something like: =IF(your_formula="","",your_formula) Hope this helps. Pete On May 14, 12:42 pm, Paul <paulmjk...@gmail.com> wrote: > Hi, > > I'm using the INDIRECT function to allow me to pl...

How to Find all my posts? How to sort by date of post?
I don't always remember to click the "notify me of replies" button, nor do I always remember the subject. And some searches return hundreds of pages of hits. How does one find just their posts? I tried searchign on my userid but that isn't reliable. On most forums there is a "show users posts" option, but I don't see how to do that with MS Forum. Also, how does one sort the search response by date? I often see search results start with posts from 2006, then 2005, up to 2009, back to 2006, then to 2004. The notification rarely works anyway....

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

IIf Statement in Query Criteria 12-11-09
I have the following code in a query: SELECT qryPointsWithDropOffDates.EMPLOYEEID, qryPointsWithDropOffDates.SSN, qryPointsWithDropOffDates.NAME, qryDisciplineNoticesReprint.LASTINCIDENTDATE, qryPointsWithDropOffDates.INCIDENTDATE, qryPointsWithDropOffDates.TYPESHORT, qryPointsWithDropOffDates.POINTVALUE FROM qryDisciplineNoticesReprint INNER JOIN qryPointsWithDropOffDates ON qryDisciplineNoticesReprint.SSN=qryPointsWithDropOffDates.SSN WHERE (((qryPointsWithDropOffDates.INCIDENTDATE) Between [qryDisciplineNoticesReprint.CALCDATE] And [qryDisciplineNoticesReprint.LASTINCIDENTD...

How to return a range of values in a drop-down.
Is there a way to have Excel return a range of values in a drop down in one cell based on input from another cell. As an example: Cell A1 has the text "PVC Pipe" I want cell A2 to get input from A1, read through a table, and return the corresponding values (sizes) of PVC pipe. The results in A2 would be the following in a drop down: 4" 6" 8" If cell A1 contained the text "Metal Pipe" it would return values (sizes) of metal pipe from a table and not display the sizes of PVC pipe. 10" 12" 15" The bottom line and...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

need a date look here
This is a multi-part message in MIME format --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Get all the hots girls @ www.pearlymae.com --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/html Content-Transfer-Encoding: quoted-printable <html> <head> <meta name=3D"GENERATOR" content=3D"Microsoft FrontPage 6.0"> <meta name=3D"ProgId" content=3D"FrontPage.Editor.Document"> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindow...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

Estimating memory usage per worksheet
Is it possible to get an estimate of the file size of a spreadsheet by individual worksheet? I cannot think of a worksheet property that would contain this, so I assume that one needs to count sheet elements and apply a per-object memory value (this only needs to be an estimate) to get the estimat. Any help would, as always, be much appreciated Thanks in advance Simon I'd try this. Start a new workbook -- with just a single sheet. Save this workbook. Note the size (using windows explorer). Then against a copy of the real workbook (just in case you mess up), c...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Using current date track budget.
Hi, I am trying to update a percentage completion cell in a budget tracking spreadsheet based on the current month. Basically I have a row for each activity and a column for each month. I enter the hours completed for each activity in each month. I have a total number of hours value which will be used to calculate the %completed. So what I need is to a formula that will calculate the following: if ( this month is April) then (sum the hours from start month to april and divide by the total hours cell) else if (this month is May) then (sum the hours from start month to april and ...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Add new record using first available non-numeric ID; update two ta
Access 2003, Windows XP Pro SP2 I have two tables, tblDed and tblVendor. tblDed contains two columns (DedID and Avail). The first column contains a list of all DedIDs allowed to be used. The second is a Yes/No choice indicating whether or not that DedID has been used already. tblVendor contains multiple columns with misc. data relevant to the Vendor. I want to create a form that will accomplish three things: 1. Use the next available unused DedID when a command button on a referring menu page (frmMenu, btnNew) is pressed. 2. Mark the now-used DedID in tblDed as "No" - no ...

EPays w/ Processing Date
I've been using MM for a number of years and have had relatively few problems...until now with MM05. I've searched this NG and FAQ web site but haven't found the issue/resolution. I have always had MM to record EPays with the PROCESSING DATE and have it checked in Settings/Online Services. MM05, however, records the transaction in the register with the SUBMITTING DATE. For example, yesterday I sent 2 payments to be paid on the 13th of the month but MM recorded yesterday's date NOT the payment date. That transaction, once submitted can't be changed as the check numbe...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Identify Duplicates (Group Records First)
Hello, I have an invoice table that includes the fields CustomerNumber and DivisionNumber. Customers can deal with multiple divisions. CustomerNumber DivisionNumber ABC Co 10 ABC Co 10 ABC Co 10 Smith Inc 10 Smith Inc 10 Jones Corp 20 Jones Corp 20 Jones Corp 10 XYZ Inc 20 XYZ Inc 20 I am trying to come up with a query that will identify that Jones Corp has records in both division 20 and 10. I would like the results ...

How to export fixed length records to a data file.
I'm creating a query for our school using the school district's standard student data format. All fields are fixed width. For example the WhiteEthnicFg field is exactly one character of either "Y" or "N". In our database we record that field as a Boolean. The Date-of-Birth District's field is an 8 character field in the format mmddyyyy. Most fields are fixed width 'Char' fields, but I don't know how to make the output match the correct width. There are decimal fields 'with one implied decimal point'. Example: 0000100 will result ...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

If it returns #N/A, making it return 0
I have a list of numbers, that at the end of their row it averages them. However, the numbers are obtained by a VLOOKUP function. If it can't find what it's looking for, it returns #N/A which makes it so it can't calculate the average at the end. Is there any way to get the VLOOKUP function to return 0 instead of #N/A? Or maybe make the cell return 0 if the VLOOKUP function returns #N/A? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Also, if it return...