Access date/time null values 
Author Message
 Access date/time null values

Hi

I have a bit of a tricky one!

I have 2 fields in an Access 2000 database, CloseDate and CloseTime
that have their properties set to shortdate and longtime respectively.

My app fills in these values without any problem.

However the problem comes when on the rare occasion I will have to
re-open these closed fields and set the date back to blank.
I can do this by opening Access and manually deleting the record but I
can find no way of doing it from my app.

I Have tried setting the corresponding text boxes to "" and " " but
this just generated an error "Data type mismatch in expression".

Does anyone know of a way to do this from VB or will I just have to do
this manually?

I could set the fields back to plain text but this would mess up my
reports when I have to produce reports based on dates/times.

Does anyone have any ideas?

thx.

--
PJ



Thu, 06 Jan 2005 02:12:48 GMT  
 Access date/time null values
SQL = "UPDATE MyTable SET CloseDate = NULL, CloseTime = NULL WHERE ( .... );

BTW, there's no need to have two fields for this. Date values include the
time. ShortDate and LongTime are display formats, that have nothing to do
with the field's data format.


Quote:
> Hi

> I have a bit of a tricky one!

> I have 2 fields in an Access 2000 database, CloseDate and CloseTime
> that have their properties set to shortdate and longtime respectively.

> My app fills in these values without any problem.

> However the problem comes when on the rare occasion I will have to
> re-open these closed fields and set the date back to blank.
> I can do this by opening Access and manually deleting the record but I
> can find no way of doing it from my app.

> I Have tried setting the corresponding text boxes to "" and " " but
> this just generated an error "Data type mismatch in expression".

> Does anyone know of a way to do this from VB or will I just have to do
> this manually?

> I could set the fields back to plain text but this would mess up my
> reports when I have to produce reports based on dates/times.

> Does anyone have any ideas?

> thx.

> --
> PJ



Thu, 06 Jan 2005 08:29:07 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access date/time null values

2. Null date values in Date/Time fields in Access DB

3. Populating Null value in SQL Date/Time field

4. Null values in Date Time Picker

5. Date Time Picker and null value

6. Passing a NULL value into a date time field

7. combining a time and a date to one Date/Time value

8. Date Time Picker & Null dates

9. ADO with Access Date/Time field not storing the time, just the date

10. How do you update a null date into an access table date field

11. how to set a date time value different from system time in the status bar

12. NULL VALUES IN DATE FIELD - TYPE MISMATCH ERROR

 

 
Powered by phpBB® Forum Software