Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SIMPLE SQL PROBLEM

Author  Topic 

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:18:35
Hi,

I dont know if im posting this in the right place so im sorry! Here is my problem...

I've made a mailing form in ASP using SQL and Access DB.

I know the follwing statement will not work but it might show what im trying to do...

COPY DateandTime FROM tblMailingList WHERE Email = ('" & Request.Form("txtemail") & "') TO SubscribeDate IN tblOldSubscription WHERE Email = ('" & Request.Form("txtemail") & "')

Any ideas??? Thanks.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-20 : 10:24:39
[code]"UPDATE D
SET D.SubscribeDate = S.DateandTime
FROM tblOldSubscription D JOIN tblMailingList S
ON D.EMAIL = S.EMAIL
WHERE D.EMAIL = '" & Request.Form("txtemail") & "'"
[/code]

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:27:23
Thanks i'll try it.
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:29:30
Im not sure what D and S are. ?
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-20 : 10:38:17
They are just aliases for the actual table names. Not sure whether it will work in Access.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:40:56
That didnt work ! sorry.

Any other ideas??
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:42:21
ill try to substitute them for the table name. brb
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:44:25
nope. still no joy.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-20 : 10:57:32
May be this?

"update tblOldSubscription, tblMailingList
set tblOldSubscription.SubscribeDate = [tblMailingList]![DateandTime]
Where (([tblOldSubscription]![EMail]=[tblMailingList]![EMail])
and [tblOldSubscription]![Email] = '" & & Request.Form("txtemail") & "')"


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 10:57:42
Surely something like (see below) Would work.
-------------------------------
dateQuery = "Copy DateandTime FROM tblMailingList TO tblOldSubscription.SubscribeDate WHERE tblMailingList.Email = tblOldSubscription.Email"
-------------------------------
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 11:01:39
nope. sorry.
Go to Top of Page

williamholmes
Starting Member

9 Posts

Posted - 2006-11-20 : 11:49:25
done it... "UPDATE tblOldSubscription, tblMailingList SET SubscribeDate=tblMailingList.DateandTime WHERE tblMailingList.Email = tblOldSubscription.Email"

Thanks for your help.
Go to Top of Page
   

- Advertisement -