Replace Date

  • Thread starter Thread starter Saz
  • Start date Start date
S

Saz

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 [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".
 
Backup database first ---
UPDATE YourTable SET YourTable.Deliv_Date = Null
WHERE (((YourTable.Deliv_Date)=#1/1/1998#));
 
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#;
 
Back
Top