Replace 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
 
D

Dorian

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".
 
K

KARL DEWEY

Backup database first ---
UPDATE YourTable SET YourTable.Deliv_Date = Null
WHERE (((YourTable.Deliv_Date)=#1/1/1998#));
 
J

John W. Vinson

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#;
 

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

Similar Threads


Top