A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Replace Date



 
 
Thread Tools Display Modes
  #1  
Old March 1st, 2010, 04:03 PM posted to microsoft.public.access.gettingstarted
Saz
external usenet poster
 
Posts: 31
Default 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  
Old March 1st, 2010, 05:01 PM posted to microsoft.public.access.gettingstarted
Dorian
external usenet poster
 
Posts: 542
Default 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  
Old March 1st, 2010, 05:05 PM posted to microsoft.public.access.gettingstarted
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old March 1st, 2010, 05:27 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.