If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Replace Date
Hi,
I have a list of Customer IDs and delivery dates as Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1/1/1998 1003 1/1/1998 1004 3/1/2010 1005 3/15/2010 Here, I am trying to query this table so that if Deliv_Date = 1/1/1998 then Deliv_Date = Null. My result should be something like this Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1003 1004 3/1/2010 1005 3/15/2010 Can you please help me to query this result using Access query? Thank you, Sajan |
#2
|
|||
|
|||
Replace Date
SELECT [Cust_Id], IIF([Deliv_Date]=#1/1/1998#,Null,[Deliv_Date]), ...
-- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". "Saz" wrote: Hi, I have a list of Customer IDs and delivery dates as Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1/1/1998 1003 1/1/1998 1004 3/1/2010 1005 3/15/2010 Here, I am trying to query this table so that if Deliv_Date = 1/1/1998 then Deliv_Date = Null. My result should be something like this Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1003 1004 3/1/2010 1005 3/15/2010 Can you please help me to query this result using Access query? Thank you, Sajan . |
#3
|
|||
|
|||
Replace Date
Backup database first ---
UPDATE YourTable SET YourTable.Deliv_Date = Null WHERE (((YourTable.Deliv_Date)=#1/1/1998#)); -- Build a little, test a little. "Saz" wrote: Hi, I have a list of Customer IDs and delivery dates as Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1/1/1998 1003 1/1/1998 1004 3/1/2010 1005 3/15/2010 Here, I am trying to query this table so that if Deliv_Date = 1/1/1998 then Deliv_Date = Null. My result should be something like this Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1003 1004 3/1/2010 1005 3/15/2010 Can you please help me to query this result using Access query? Thank you, Sajan . |
#4
|
|||
|
|||
Replace Date
On Mon, 1 Mar 2010 08:03:09 -0800 (PST), Saz wrote:
Hi, I have a list of Customer IDs and delivery dates as Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1/1/1998 1003 1/1/1998 1004 3/1/2010 1005 3/15/2010 Here, I am trying to query this table so that if Deliv_Date = 1/1/1998 then Deliv_Date = Null. My result should be something like this Cust_ID Deliv_Date 1000 2/24/2010 1001 2/25/2010 1002 1003 1004 3/1/2010 1005 3/15/2010 Can you please help me to query this result using Access query? Thank you, Sajan SELECT CustID, IIF([Deliv_Date] = #1/1/1998#, NULL, [Deliv_Date]) AS New_Deliv_Date; If you wish to make this change permanent, you can run an Update query updating Deliv_Date to NULL: UPDATE mytable SET Deliv_Date = Null WHERE Deliv_Date = #1/1/1998#; -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|