H
Hermie
hello
I like to know if a expression is just a function or an SQL statement?
Herman
I like to know if a expression is just a function or an SQL statement?
Herman
Hermie said:Hello Rick
I have an expression like: =IIf(DatePart("m",[DATE_GESTION]=True And
DatePart("yyyy",[DATE_GESTION]=True)),DLookUp("[meses]","meses","idmes = "
&
DatePart("m",[DATE_GESTION])) & " de " &
DatePart("yyyy",[DATE_GESTION]),"NEE")
I want to know if this is just a function or a SQL statement
Herman
Rick B said:Ok, what is the statement? What are you asking here?
George Nicholson said:There is no SQL in that expression. IIf, DatePart, DLookUp are all
functions.
paraphrased/restated:
If Date_Gestion is a date, return the value of [field] meses from "table"
meses where field idmes = "month de year" of Date_Gestion. If Date_Gestion
isn't a date, return NEE.
HTH,
--
George Nicholson
Remove 'Junk' from return address.
Hermie said:Hello Rick
I have an expression like: =IIf(DatePart("m",[DATE_GESTION]=True And
DatePart("yyyy",[DATE_GESTION]=True)),DLookUp("[meses]","meses","idmes =
" &
DatePart("m",[DATE_GESTION])) & " de " &
DatePart("yyyy",[DATE_GESTION]),"NEE")
I want to know if this is just a function or a SQL statement
Herman
Rick B said:Ok, what is the statement? What are you asking here?
hello
I like to know if a expression is just a function or an SQL
statement?
Herman
George Nicholson said:There is no SQL in that expression. IIf, DatePart, DLookUp are all
functions.
paraphrased/restated:
If Date_Gestion is a date, return the value of [field] meses from "table"
meses where field idmes = "month de year" of Date_Gestion. If Date_Gestion
isn't a date, return NEE.
HTH,
--
George Nicholson
Remove 'Junk' from return address.
Hermie said:Hello Rick
I have an expression like: =IIf(DatePart("m",[DATE_GESTION]=True And
DatePart("yyyy",[DATE_GESTION]=True)),DLookUp("[meses]","meses","idmes = "
&
DatePart("m",[DATE_GESTION])) & " de " &
DatePart("yyyy",[DATE_GESTION]),"NEE")
I want to know if this is just a function or a SQL statement
Herman
Rick B said:Ok, what is the statement? What are you asking here?
hello
I like to know if a expression is just a function or an SQL
statement?
Herman
George Nicholson said:Note that DatePart returns integers so:
DatePart("m",[DATE_GESTION])) & " de " &
DatePart("yyyy",[DATE_GESTION])
would return "1 de 2005", "2 de 2005" for DATE_GESTION values falling in
January and February 2005.
If idmes values aren't in that format, nothing will ever get returned.
--
George Nicholson
Remove 'Junk' from return address.
George Nicholson said:There is no SQL in that expression. IIf, DatePart, DLookUp are all
functions.
paraphrased/restated:
If Date_Gestion is a date, return the value of [field] meses from "table"
meses where field idmes = "month de year" of Date_Gestion. If Date_Gestion
isn't a date, return NEE.
HTH,
--
George Nicholson
Remove 'Junk' from return address.
Hermie said:Hello Rick
I have an expression like: =IIf(DatePart("m",[DATE_GESTION]=True And
DatePart("yyyy",[DATE_GESTION]=True)),DLookUp("[meses]","meses","idmes =
" &
DatePart("m",[DATE_GESTION])) & " de " &
DatePart("yyyy",[DATE_GESTION]),"NEE")
I want to know if this is just a function or a SQL statement
Herman
"Rick B" <Anonymous> wrote in message
Ok, what is the statement? What are you asking here?
hello
I like to know if a expression is just a function or an SQL
statement?
Herman
Hermie said:Hello George
Many thanks for your answer, I needed this because my colleague said it is
an SQL statement and I said it is not,
BTW this expression works perfectly I use it in my report header to show
the
month and year of the report
Herman
George Nicholson said:There is no SQL in that expression. IIf, DatePart, DLookUp are all
functions.
paraphrased/restated:
If Date_Gestion is a date, return the value of [field] meses from
"table"
meses where field idmes = "month de year" of Date_Gestion. If
Date_Gestion
isn't a date, return NEE.
HTH,
--
George Nicholson
Remove 'Junk' from return address.
Hermie said:Hello Rick
I have an expression like: =IIf(DatePart("m",[DATE_GESTION]=True And
DatePart("yyyy",[DATE_GESTION]=True)),DLookUp("[meses]","meses","idmes
= "
&
DatePart("m",[DATE_GESTION])) & " de " &
DatePart("yyyy",[DATE_GESTION]),"NEE")
I want to know if this is just a function or a SQL statement
Herman
"Rick B" <Anonymous> wrote in message
Ok, what is the statement? What are you asking here?
hello
I like to know if a expression is just a function or an SQL
statement?
Herman
George said:DLookup could be viewed as similar to a SQL function (if there were such a
thing)
but it is really a method of the Access Application object. It is
no more SQL than Excel's DGET function is.
DatePart is a VisualBasic function
iif is part of VBA