Queries from Access

P

Patrice

Finally quite close from my suggestion ;-)

As suggested earlier you may want to avoid converting when not necessary.
Here my personal preference would be to compare date values rather than
converting them to text before doing the comparison.


James said:
Hello

I've Done it!!!!! The problem was that UK and USA dates are different, so
I
had to add code to format both dates into UK before comparing them. My
computer it worked fine as its UK same as data, but ASP.Net is obviously
USA
so when on the server it was looking for a day instead of a month.

Final code is:

SELECT supportmember.supportid, supportmember.datetaken, icb.[number],
icb.firstname, icb.lastname, RIGHT (LEFT (supportmember.datetaken, 8), 5)
AS
Expr1 FROM (supportmember INNER JOIN icb ON supportmember.memid =
icb.memid)
WHERE (supportmember.supportid = ?) AND
((Right(Left(Format([datetaken],"dd/mm/yy"),8),5))=Right(Format(DateAdd("m",-1,Date()),"dd/mm/yy"),5))
ORDER BY supportmember.datetaken DESC

Wow this one confused me for days.

Many thanks for your help, keep up the good work.

Cheers
James

James said:
Hello all

I am having a odd problem, I have a page that lists users (GridView),
this
list links through to another page when you click on the name. The second
page lists all phone calls they received during the previous month
(GridView). I have done this by a Querystring passing SupportId from the
first to the second page.

The second page GridView data source is based on an SQL statement:
"WHERE (supportid = ?) AND
((Right(Left([datetaken],8),5))=Right(DateAdd("m",-1,Date()),5))"

the [datetaken] field is the date and time the call was received.

This works fine on my computer running it under a local host. However,
when
I copy it to my IIS server V6, it does not show any records on the second
page.

Everything else works fine, the list on the first page works ok, even the
second page loads fine but it says No Calls.

Does anyone have a clue why? I have tried almost everything I can think
off
but nothing makes a difference.
Many thanks in advance

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top