Get values from another table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI
If i have
if weekday(start) =
and i want the values from another table how
can i do this.

like:
if weekday(start) = table.tablename.field or something like that

Hope someone understand and can help

alvin
 
If you want to get a value from a table then use the DLookUp command but a
table can contain several records so you must specify criteria to get the
correct value from the relevant record.

Dim intTemp as Integer

intTemp = DLookUp("[FieldName]","TableName","Criteria")
if weekday(start) = intTemp then
...... etc.
 
Thanks
But what i very want is to use this in a loop
like:
Do While start < [slutdato]
If Weekday(start) = from the other table
weekend = weekend + 1
End If
start = start + 1
Loop

alvin


"Dennis" skrev:
If you want to get a value from a table then use the DLookUp command but a
table can contain several records so you must specify criteria to get the
correct value from the relevant record.

Dim intTemp as Integer

intTemp = DLookUp("[FieldName]","TableName","Criteria")
if weekday(start) = intTemp then
..... etc.

Alvin Hansen said:
HI
If i have
if weekday(start) =
and i want the values from another table how
can i do this.

like:
if weekday(start) = table.tablename.field or something like that

Hope someone understand and can help

alvin
 
I don't really understand what you are trying to do in this loop. Are you
trying to calculate how many weekends between 2 dates ?
Weekday(start) will give you a number between 1 and 7. You are then trying
to get something from another table where 1 to 7 matches something ?
What is it matching against in the other table ?

Alvin Hansen said:
Thanks
But what i very want is to use this in a loop
like:
Do While start < [slutdato]
If Weekday(start) = from the other table
weekend = weekend + 1
End If
start = start + 1
Loop

alvin


"Dennis" skrev:
If you want to get a value from a table then use the DLookUp command but a
table can contain several records so you must specify criteria to get the
correct value from the relevant record.

Dim intTemp as Integer

intTemp = DLookUp("[FieldName]","TableName","Criteria")
if weekday(start) = intTemp then
..... etc.

Alvin Hansen said:
HI
If i have
if weekday(start) =
and i want the values from another table how
can i do this.

like:
if weekday(start) = table.tablename.field or something like that

Hope someone understand and can help

alvin
 
Sorry wrong way to explain
here it is
Do While start < [slutdate]
If start = 'from the other table there is a date start is also a date '
then
name = name +1
start = start + 1
Loop

"Dennis" skrev:
I don't really understand what you are trying to do in this loop. Are you
trying to calculate how many weekends between 2 dates ?
Weekday(start) will give you a number between 1 and 7. You are then trying
to get something from another table where 1 to 7 matches something ?
What is it matching against in the other table ?

Alvin Hansen said:
Thanks
But what i very want is to use this in a loop
like:
Do While start < [slutdato]
If Weekday(start) = from the other table
weekend = weekend + 1
End If
start = start + 1
Loop

alvin


"Dennis" skrev:
If you want to get a value from a table then use the DLookUp command but a
table can contain several records so you must specify criteria to get the
correct value from the relevant record.

Dim intTemp as Integer

intTemp = DLookUp("[FieldName]","TableName","Criteria")
if weekday(start) = intTemp then
..... etc.

:

HI
If i have
if weekday(start) =
and i want the values from another table how
can i do this.

like:
if weekday(start) = table.tablename.field or something like that

Hope someone understand and can help

alvin
 
You may want to answer the question that "DENNIS" asked below as in...

The majority of development is not about the code, but about
understanding what your trying to implement.

Alvin said:
Sorry wrong way to explain
here it is
Do While start < [slutdate]
If start = 'from the other table there is a date start is also a date '
then
name = name +1
start = start + 1
Loop

"Dennis" skrev:

:

Thanks
But what i very want is to use this in a loop
like:
Do While start < [slutdato]
If Weekday(start) = from the other table
weekend = weekend + 1
End If
start = start + 1
Loop

alvin


"Dennis" skrev:


If you want to get a value from a table then use the DLookUp command but a
table can contain several records so you must specify criteria to get the
correct value from the relevant record.

Dim intTemp as Integer

intTemp = DLookUp("[FieldName]","TableName","Criteria")
if weekday(start) = intTemp then
..... etc.

:


HI
If i have
if weekday(start) =
and i want the values from another table how
can i do this.

like:
if weekday(start) = table.tablename.field or something like that

Hope someone understand and can help

alvin
 
Sorry

Start is a date
and i want to lookup in another table and see if this date are in this table
this i want to do i a loop
where start = start+1
and so on

hope i know have explain my self

Alvin


"David C. Holley" skrev:
You may want to answer the question that "DENNIS" asked below as in...

The majority of development is not about the code, but about
understanding what your trying to implement.

Alvin said:
Sorry wrong way to explain
here it is
Do While start < [slutdate]
If start = 'from the other table there is a date start is also a date '
then
name = name +1
start = start + 1
Loop

"Dennis" skrev:

:


Thanks
But what i very want is to use this in a loop
like:
Do While start < [slutdato]
If Weekday(start) = from the other table
weekend = weekend + 1
End If
start = start + 1
Loop

alvin


"Dennis" skrev:


If you want to get a value from a table then use the DLookUp command but a
table can contain several records so you must specify criteria to get the
correct value from the relevant record.

Dim intTemp as Integer

intTemp = DLookUp("[FieldName]","TableName","Criteria")
if weekday(start) = intTemp then
..... etc.

:


HI
If i have
if weekday(start) =
and i want the values from another table how
can i do this.

like:
if weekday(start) = table.tablename.field or something like that

Hope someone understand and can help

alvin
 
Back
Top