473,657 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Acs2k DatePart Question.

Hi All,

I have one table TABLE1 in access2k on machine PC1, that has one
column named DO_DATE with "Date/Time" data type. Two other machines
PC2 and PC3 also running access2k. Each PC has its own data entry
form, and each form would execute the following insert query
independently:

INSERT INTO TABLE1 (DO_DATE, ... )
SELECT DatePart("m",[othTABLE].[Do_Date]) & "/" &
DatePart("yyyy" ,[othTABLE].[Do_Date]) AS Do_Date, ...
FROM othTABLE ...etc

My results:
PC1 would always insert correctly (ie, 01/12/2004);
PC2 would always insert NULL !!!

Question:
All the machines were installed with the same version of Access2k, ie
(9.0.2720); why same insert query on different machine could result
differently ?
Thanks
sean
Nov 13 '05 #1
1 1660
There could be a difference in JET service pack, or the date formats in
Regional Options (in the Windows Control Panel).

There is no need to parse this value though. Assuming that Do_Date is a
date/time field (not a text field), just assign the date. Or if you are
trying aiming to get the 1st of the month, you could use:
SELECT DateSerial(Year ([othTABLE].[Do_Date]),
Month([othTABLE].[Do_Date]), 1) AS Expr1, ...

BTW, you reallly, desperately need to apply some service packs to these
A2000 installations. SP3 will take you up to 9.0.6620. And you need to apply
at least SP7 (preferably sp8) for JET 4 as well. Both are available in the
Downloads from support.microso ft.com. IMHO, A2000 without the service packs
is actually unusuable.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"sean" <se******@hotma il.com> wrote in message
news:10******** *************** ***@posting.goo gle.com...
Hi All,

I have one table TABLE1 in access2k on machine PC1, that has one
column named DO_DATE with "Date/Time" data type. Two other machines
PC2 and PC3 also running access2k. Each PC has its own data entry
form, and each form would execute the following insert query
independently:

INSERT INTO TABLE1 (DO_DATE, ... )
SELECT DatePart("m",[othTABLE].[Do_Date]) & "/" &
DatePart("yyyy" ,[othTABLE].[Do_Date]) AS Do_Date, ...
FROM othTABLE ...etc

My results:
PC1 would always insert correctly (ie, 01/12/2004);
PC2 would always insert NULL !!!

Question:
All the machines were installed with the same version of Access2k, ie
(9.0.2720); why same insert query on different machine could result
differently ?
Thanks
sean

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6296
by: David | last post by:
Hi Group, i am trying to use the DatePart function on my SQL2000 database. I have a table called visitors with a field called DateTimeEntrance which is filled everytime a visitor enters the site. I am trying to build a stat page where i display the total amount of visitors per day, week, month, year and i can't seem to get the syntax correct. I get an error with the following code: sql = "SELECT * FROM tblVisitors WHERE...
2
2459
by: Tipple | last post by:
I'm trying to increment between the end of lunch and the end of the day. The code below is returning a datePart of 13 instead of 1 (for 1:00:00 PM) and 14 instead of 2:00:00 PM etc.. If response.write just counter2 I get a real hour. How can I return the actual hour datePart? lunchStart = "12:00:00 PM" lunchEnd = "1:00:00 PM"
2
4490
by: sdowney717 | last post by:
The field itemdate is a datetime field in sqlserver2000 DB This works fine: Select Id From BookData Where (MONTH(itemdate) = '01') and (DAY(itemdate) = '02') and (YEAR(itemdate) = '2005') order by TitleDuplicate This does not work: Select Id From BookData Where (MONTH(itemdate) = '01') and (DAY(itemdate) = '02') and (YEAR(itemdate) = '2005') and (datepart(Hh,
3
12580
by: david liu | last post by:
i have a date (in date/time format with input mask) in access 2002. field date: 01/01/1970 what i want: 010170 (i.e. mmddyy) i used: DatePart("m",) + DatePart("d",) + right(DatePart("yyyy",), 2) and i get: 1170
2
2015
by: Aaran76 | last post by:
I am creating a booking system in ASP.Net with VB and a MSSQL backend. I am having problems knowing where to begin with a particular part of the system. Bookings can only be made in weekly multiples from Saturday to Saturday. The only way I can think of to do it is by manually adding the weeks into a table in the DB, but this will obviously mean that I will have to routinely update this table.
3
9863
by: S. van Beek | last post by:
Dear reader, With DatePart() you can subtract the year or the week from a date field with: DatePart("yyyy";) for the year
2
6793
by: troddy | last post by:
I am using the DatePart funtion in a query to extract the day, month and year in separate fields in a query. The function works fine but I am only getting a number for the month even if the field type is a long date and the month is stored in the table. I tried the following to try and get the name of the month to work. DateTest: Format(DatePart("m",),"mmmm") The DateAffirmed field had a date stored of 16/03/2006.
2
2126
by: le0 | last post by:
Hello guys, Is there anything wrong with my code (see below) bcoz when 10p-6a shift my browser returns the error cannot be a zero-length string. Im wondering why, bcoz the 2 other shift works perfectly. <% 'Shift: 6a-2p if DatePart("h", Now()) 5 And DatePart("h", Now()) < 14 then ShiftID = "A"
3
3607
by: grabit | last post by:
Hi Peoples I am having probs with the datepart function with a query.What i want is to get all listings made in any month in any year ie May 2007 i have 2 drop down boxes to select the listedmonth and listedyear on the refering page I need to be able to retrieve this so i can send out renewals to those listings for another year. I am using this query <cfquery name="getrenew" datasource="#dsn#"> SELECT datelisted FROM listings WHERE...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.