473,414 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

change a number to positive value

I have an expression that returns the week number in a row but descending
from a date:

Week Number:
DateDiff("ww",DateAdd("ww",1,forms!FrmBookingCurve Input!TxtStart.value),[The
Date])

It allows me to pass values to a graph thats shows bookings over a 20 week
period.

because of the nature of the datediff it returns negative values. I would
like to see on the graph a positive.

How might I change that figure to a positve ? is there an easy function that
I can use in the query grid?

regards
Peter
Nov 13 '05 #1
5 7875
Abs() returns the absolute value of a number (i.e. ignores the sign).

Week Number:
Abs(DateDiff("ww",DateAdd("ww",1,forms!FrmBookingC urveInput!TxtStart.value),[The
Date]))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:cj**********@newsg3.svr.pol.co.uk...
I have an expression that returns the week number in a row but descending
from a date:

Week Number:
DateDiff("ww",DateAdd("ww",1,forms!FrmBookingCurve Input!TxtStart.value),[The
Date])

It allows me to pass values to a graph thats shows bookings over a 20 week
period.

because of the nature of the datediff it returns negative values. I would
like to see on the graph a positive.

How might I change that figure to a positve ? is there an easy function
that
I can use in the query grid?

regards
Peter

Nov 13 '05 #2
Thanks Allen that worked just a treat. One other question here is an example
of the row returned by the query that returns week numbers. What I would
like is it to ignore part of the week ie the last record has monday only in
week one.

Qrygetdailycountofdosmoduleenrollments Date Number of Module Enrollments
Day of the Week Week Number
14/04/2003 1 Monday 21
15/04/2003 0 Tuesday 21
16/04/2003 2 Wednesday 21
17/04/2003 0 Thursday 21
18/04/2003 0 Friday 21
21/04/2003 0 Monday 20
22/04/2003 0 Tuesday 20
23/04/2003 1 Wednesday 20
24/04/2003 0 Thursday 20
25/04/2003 1 Friday 20
28/04/2003 0 Monday 19
29/04/2003 0 Tuesday 19
30/04/2003 1 Wednesday 19
01/05/2003 2 Thursday 19
02/05/2003 2 Friday 19
05/05/2003 0 Monday 18
06/05/2003 0 Tuesday 18
07/05/2003 1 Wednesday 18
08/05/2003 2 Thursday 18
09/05/2003 0 Friday 18
12/05/2003 0 Monday 17
13/05/2003 1 Tuesday 17
14/05/2003 0 Wednesday 17
15/05/2003 2 Thursday 17
16/05/2003 0 Friday 17
19/05/2003 1 Monday 16
20/05/2003 1 Tuesday 16
21/05/2003 0 Wednesday 16
22/05/2003 1 Thursday 16
23/05/2003 0 Friday 16
26/05/2003 0 Monday 15
27/05/2003 0 Tuesday 15
28/05/2003 0 Wednesday 15
29/05/2003 1 Thursday 15
30/05/2003 0 Friday 15
02/06/2003 5 Monday 14
03/06/2003 0 Tuesday 14
04/06/2003 0 Wednesday 14
05/06/2003 2 Thursday 14
06/06/2003 0 Friday 14
09/06/2003 1 Monday 13
10/06/2003 3 Tuesday 13
11/06/2003 0 Wednesday 13
12/06/2003 0 Thursday 13
13/06/2003 0 Friday 13
16/06/2003 0 Monday 12
17/06/2003 0 Tuesday 12
18/06/2003 1 Wednesday 12
19/06/2003 0 Thursday 12
20/06/2003 2 Friday 12
23/06/2003 3 Monday 11
24/06/2003 2 Tuesday 11
25/06/2003 4 Wednesday 11
26/06/2003 0 Thursday 11
27/06/2003 2 Friday 11
30/06/2003 0 Monday 10
01/07/2003 2 Tuesday 10
02/07/2003 2 Wednesday 10
03/07/2003 4 Thursday 10
04/07/2003 0 Friday 10
07/07/2003 3 Monday 9
08/07/2003 3 Tuesday 9
09/07/2003 0 Wednesday 9
10/07/2003 2 Thursday 9
11/07/2003 5 Friday 9
14/07/2003 1 Monday 8
15/07/2003 3 Tuesday 8
16/07/2003 0 Wednesday 8
17/07/2003 1 Thursday 8
18/07/2003 5 Friday 8
21/07/2003 0 Monday 7
22/07/2003 1 Tuesday 7
23/07/2003 4 Wednesday 7
24/07/2003 3 Thursday 7
25/07/2003 9 Friday 7
28/07/2003 1 Monday 6
29/07/2003 5 Tuesday 6
30/07/2003 5 Wednesday 6
31/07/2003 0 Thursday 6
01/08/2003 1 Friday 6
04/08/2003 5 Monday 5
05/08/2003 3 Tuesday 5
06/08/2003 3 Wednesday 5
07/08/2003 2 Thursday 5
08/08/2003 0 Friday 5
11/08/2003 3 Monday 4
12/08/2003 2 Tuesday 4
13/08/2003 0 Wednesday 4
14/08/2003 3 Thursday 4
15/08/2003 1 Friday 4
18/08/2003 2 Monday 3
19/08/2003 1 Tuesday 3
20/08/2003 3 Wednesday 3
21/08/2003 0 Thursday 3
22/08/2003 4 Friday 3
25/08/2003 0 Monday 2
26/08/2003 2 Tuesday 2
27/08/2003 5 Wednesday 2
28/08/2003 1 Thursday 2
29/08/2003 1 Friday 2
01/09/2003 0 Monday 1
regards
Peter
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Abs() returns the absolute value of a number (i.e. ignores the sign).

Week Number:
Abs(DateDiff("ww",DateAdd("ww",1,forms!FrmBookingC urveInput!TxtStart.value),
[The Date]))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:cj**********@newsg3.svr.pol.co.uk...
I have an expression that returns the week number in a row but descending
from a date:

Week Number:
DateDiff("ww",DateAdd("ww",1,forms!FrmBookingCurve Input!TxtStart.value),[The Date])

It allows me to pass values to a graph thats shows bookings over a 20 week period.

because of the nature of the datediff it returns negative values. I would like to see on the graph a positive.

How might I change that figure to a positve ? is there an easy function
that
I can use in the query grid?

regards
Peter


Nov 13 '05 #3
Whenever you work by "weeks", you have this kind of issue.

Not sure what result you are after, whether you want to use criteria to
filter out certain weeks, or use the 3rd argument of DatePart() to specify
what day should be considered the start of the week, or ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:cj**********@news6.svr.pol.co.uk...
Thanks Allen that worked just a treat. One other question here is an
example
of the row returned by the query that returns week numbers. What I would
like is it to ignore part of the week ie the last record has monday only
in
week one.

Qrygetdailycountofdosmoduleenrollments Date Number of Module Enrollments
Day of the Week Week Number
14/04/2003 1 Monday 21
15/04/2003 0 Tuesday 21

Nov 13 '05 #4
I just discovered it I changed the "ww" to "w" and then filtered out <21 in
the grid for criteria.

Thanks Allen for replying so quickly, i was just about to post my solution.

youve helped me a lot over the past few weeks and the form is now looking
really professional albeit from me an unprofessional.

Regards

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Whenever you work by "weeks", you have this kind of issue.

Not sure what result you are after, whether you want to use criteria to
filter out certain weeks, or use the 3rd argument of DatePart() to specify
what day should be considered the start of the week, or ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:cj**********@news6.svr.pol.co.uk...
Thanks Allen that worked just a treat. One other question here is an
example
of the row returned by the query that returns week numbers. What I would
like is it to ignore part of the week ie the last record has monday only
in
week one.

Qrygetdailycountofdosmoduleenrollments Date Number of Module Enrollments Day of the Week Week Number
14/04/2003 1 Monday 21
15/04/2003 0 Tuesday 21


Nov 13 '05 #5
"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in
news:cj**********@newsg3.svr.pol.co.uk:
I have an expression that returns the week number in a row but
descending from a date:

Week Number:
DateDiff("ww",DateAdd("ww",1,forms!FrmBookingCurve Input!TxtStar
t.value),[The Date])

It allows me to pass values to a graph thats shows bookings
over a 20 week period.

because of the nature of the datediff it returns negative
values. I would like to see on the graph a positive.

How might I change that figure to a positve ? is there an easy
function that I can use in the query grid?

regards
Peter

Just exchange the positions of the two date expressions, e.g. put
[the date] before forms!Frm.....

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
7
by: hasanainf | last post by:
Hi all, I have two querys QueryPurchased ProductID Location TotPcs Prod1 Loc1 100 Prod2 Loc1 50 Prod3 Loc1 150 Prod3 Loc3 150
5
by: Subrahmanyam Arya | last post by:
Hi Folks , I am trying to solve the problem of reading the numbers correctly from a serial line into an intel pentium processor machine . I am reading 1 byte and 2byte data both positive...
10
by: chanma | last post by:
code1:var x=0xf0000000; alert(x); output:4026531840 code2:var b=0xf<<28; alert(b); output:-268435456
11
by: free4trample | last post by:
First of all let me say that I know very little about javascript. what i need to do is to write a javascript functin which will change the background color of the table rows based on entrees in...
43
by: Xancatal | last post by:
Hey everybody. I need help on this one. I need to verify that a number entered by a user is not either a negative number (-100.00), or an alphabet (a, b, c, X, Y) as well as other number other than...
29
by: fdmfdmfdm | last post by:
let's say without checking including files, how do we to represent the biggest say int in a system? I ran across a book give this code: long int biggest = 0x7FFFFFFF; Does that mean the...
28
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
63
by: deepak | last post by:
Hi, Can someone give the standard function which can create positive integer value in C? Thanks, Deepak
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.