Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 223
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Changing data types

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Changing the data type of a field through code Janelle.Dunlap@ge.com Information Technology 0 28-Jul-2006 08:16 AM
changing data type Boots Information Technology 7 28-Jul-2006 08:13 AM
user defined data types in VBA HSalim[MVP] Information Technology 0 28-Jul-2006 08:01 AM
Changing data in a table Chris Information Technology 2 12-Nov-2005 22:39 PM
Notifying a user when changing data. Andrey Information Technology 2 28-Oct-2005 18:00 PM


Tags
changing, data, types
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:41 AM
Andreas's Avatar Andreas
Guest
 
Posts: n/a
   
   
Changing data types

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I have a field called "date" which contains 250 000 rows. It contins dates in
the yyyymmdd form. However, it has the data type "numbers". i would like to
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13883-changing-data-types.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
change this to the data type "date/time" but when I do this all the
information just disappears. Why? Do I have to change the yyyymmdd to one of
the given types, for example, the yyyy-mm-dd form first? I have tried to do
this but it does not work either...

/Andreas

*








 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:41 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Changing data types

Here is a safe approach:

1. Open your table in design view.

2. Add a new field of Date/Time to accept the real date.

3. Save. Close the table.

4. Create a query using this table.

5. Change it to an Update query (Update on Query menu.)

6. Drag the existing number date (named "d" in this example) into the grid.
In the Criteria row, enter:
Between 19000101 And 29990101
so that nulls and shorter/longer numbers are excluded.

7. Drag the new date field (created at step 2) into the grid.
In the Update row under this query, enter:
DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
replacing d with the name of your field.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883

8. Test that the results are right.
Then delete the old Number field from your table.

How it works:
DateSerial() builds a date from year, month, day.
The integer division (\ operator) and left-over (mod operator) get these
values from the number.

It is also possible to parse the numbers with string operators such as
Left(), Mid() and Right(), but the numeric operators would be more
efficient.

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

"Andreas" wrote in message
news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
>I have a field called "date" which contains 250 000 rows. It contins dates
>in
> the yyyymmdd form. However, it has the data type "numbers". i would like
> to
> change this to the data type "date/time" but when I do this all the
> information just disappears. Why? Do I have to change the yyyymmdd to one
> of
> the given types, for example, the yyyy-mm-dd form first? I have tried to
> do
> this but it does not work either...
>
> /Andreas



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:41 AM
Andreas's Avatar Andreas
Guest
 
Posts: n/a
   
   
Re: Changing data types

Thanks for your help

But I am getting the message below when I do this. Unfortunately it is in
Italian:

"Operatore punto (.) o punto esclamativo (!) non valido oppure parentesi non
valide nell espressione"

"Puo esser stato immesso un identificatore non valido o possono essere state
digitate delle parentesi dopo la costante null"

Does this tell you anything even if it is in Italian?

/andreas

"Allen Browne" skrev:

> Here is a safe approach:
>
> 1. Open your table in design view.
>
> 2. Add a new field of Date/Time to accept the real date.
>
> 3. Save. Close the table.
>
> 4. Create a query using this table.
>
> 5. Change it to an Update query (Update on Query menu.)
>
> 6. Drag the existing number date (named "d" in this example) into the grid.
> In the Criteria row, enter:
> Between 19000101 And 29990101
> so that nulls and shorter/longer numbers are excluded.
>
> 7. Drag the new date field (created at step 2) into the grid.
> In the Update row under this query, enter:
> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
> replacing d with the name of your field.
>
> 8. Test that the results are right.
> Then delete the old Number field from your table.
>
> How it works:
> DateSerial() builds a date from year, month, day.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> The integer division (\ operator) and left-over (mod operator) get these
> values from the number.
>
> It is also possible to parse the numbers with string operators such as
> Left(), Mid() and Right(), but the numeric operators would be more
> efficient.
>
> --
> 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.
>
> "Andreas" wrote in message
> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
> >I have a field called "date" which contains 250 000 rows. It contins dates
> >in
> > the yyyymmdd form. However, it has the data type "numbers". i would like
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> > to
> > change this to the data type "date/time" but when I do this all the
> > information just disappears. Why? Do I have to change the yyyymmdd to one
> > of
> > the given types, for example, the yyyy-mm-dd form first? I have tried to
> > do
> > this but it does not work either...
> >
> > /Andreas

>
>
>

Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:41 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Changing data types

Perhaps someone who reads Italian can help.

At what step does it happen?
If it is in the query, switch your query to SQL View, and paste the SQL
statement here. We might be able to see from that what's going on.

If you have spaces or other odd characters in your table/field names,
enclose them in square brackets.

--
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.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883

"Andreas" wrote in message
news:9ED91745-891E-4A86-8AAA-ECEC424EB9D8@microsoft.com...
> Thanks for your help
>
> But I am getting the message below when I do this. Unfortunately it is in
> Italian:
>
> "Operatore punto (.) o punto esclamativo (!) non valido oppure parentesi
> non
> valide nell espressione"
>
> "Puo esser stato immesso un identificatore non valido o possono essere
> state
> digitate delle parentesi dopo la costante null"
>
> Does this tell you anything even if it is in Italian?
>
> /andreas
>
> "Allen Browne" skrev:
>
>> Here is a safe approach:
>>
>> 1. Open your table in design view.
>>
>> 2. Add a new field of Date/Time to accept the real date.
>>
>> 3. Save. Close the table.
>>
>> 4. Create a query using this table.
>>
>> 5. Change it to an Update query (Update on Query menu.)
>>
>> 6. Drag the existing number date (named "d" in this example) into the
>> grid.
>> In the Criteria row, enter:
>> Between 19000101 And 29990101
>> so that nulls and shorter/longer numbers are excluded.
>>
>> 7. Drag the new date field (created at step 2) into the grid.
>> In the Update row under this query, enter:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
>> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
>> replacing d with the name of your field.
>>
>> 8. Test that the results are right.
>> Then delete the old Number field from your table.
>>
>> How it works:
>> DateSerial() builds a date from year, month, day.
>> The integer division (\ operator) and left-over (mod operator) get these
>> values from the number.
>>
>> It is also possible to parse the numbers with string operators such as
>> Left(), Mid() and Right(), but the numeric operators would be more
>> efficient.
>>
>> "Andreas" wrote in message
>> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
>> >I have a field called "date" which contains 250 000 rows. It contins
>> >dates
>> >in
>> > the yyyymmdd form. However, it has the data type "numbers". i would
>> > like
>> > to
>> > change this to the data type "date/time" but when I do this all the
>> > information just disappears. Why? Do I have to change the yyyymmdd to
>> > one
>> > of
>> > the given types, for example, the yyyy-mm-dd form first? I have tried
>> > to
>> > do
>> > this but it does not work either...



Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:41 AM
Andreas's Avatar Andreas
Guest
 
Posts: n/a
   
   
Re: Changing data types

It happens in the step when I write the code in the update field. Have I
understood it right. I have two fields in my new question. On with the old
date-field that is called Consegna here, There I write the criteria. Then I
have a new field with the new date-field called date here. Then I write the
text you gave me in the update field in field called date. The message comes
when I want to confirm the written text in the field by ´leaving the field.
So it is not possible to change to SQL-view without erasing the text that you
gave me. But if I erase it the sql says:

Update jhmc1 SET
Where (((jhmc1.Consegna) Between 19000101 And 29990101

That's it, but their is no problem so far as I said, it is when I type the
text you gave me in step 7 the problems start!

Thanks

"Allen Browne" skrev:

> Perhaps someone who reads Italian can help.
>
> At what step does it happen?
> If it is in the query, switch your query to SQL View, and paste the SQL
> statement here. We might be able to see from that what's going on.
>
> If you have spaces or other odd characters in your table/field names,
> enclose them in square brackets.
>
> --
> 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.
>
> "Andreas" wrote in message
> news:9ED91745-891E-4A86-8AAA-ECEC424EB9D8@microsoft.com...
> > Thanks for your help
> >
> > But I am getting the message below when I do this. Unfortunately it is in
> > Italian:
> >
> > "Operatore punto (.) o punto esclamativo (!) non valido oppure parentesi
> > non
> > valide nell espressione"
> >
> > "Puo esser stato immesso un identificatore non valido o possono essere
> > state
> > digitate delle parentesi dopo la costante null"
> >
> > Does this tell you anything even if it is in Italian?
> >
> > /andreas
> >
> > "Allen Browne" skrev:
> >
> >> Here is a safe approach:
> >>
> >> 1. Open your table in design view.
> >>
> >> 2. Add a new field of Date/Time to accept the real date.
> >>
> >> 3. Save. Close the table.
> >>
> >> 4. Create a query using this table.
> >>
> >> 5. Change it to an Update query (Update on Query menu.)
> >>
> >> 6. Drag the existing number date (named "d" in this example) into the
> >> grid.
> >> In the Criteria row, enter:
> >> Between 19000101 And 29990101
> >> so that nulls and shorter/longer numbers are excluded.
> >>
> >> 7. Drag the new date field (created at step 2) into the grid.
> >> In the Update row under this query, enter:
> >> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
> >> replacing d with the name of your field.
> >>
> >> 8. Test that the results are right.
> >> Then delete the old Number field from your table.
> >>
> >> How it works:
> >> DateSerial() builds a date from year, month, day.
> >> The integer division (\ operator) and left-over (mod operator) get these
> >> values from the number.
> >>
> >> It is also possible to parse the numbers with string operators such as
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> >> Left(), Mid() and Right(), but the numeric operators would be more
> >> efficient.
> >>
> >> "Andreas" wrote in message
> >> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
> >> >I have a field called "date" which contains 250 000 rows. It contins
> >> >dates
> >> >in
> >> > the yyyymmdd form. However, it has the data type "numbers". i would
> >> > like
> >> > to
> >> > change this to the data type "date/time" but when I do this all the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> >> > information just disappears. Why? Do I have to change the yyyymmdd to
> >> > one
> >> > of
> >> > the given types, for example, the yyyy-mm-dd form first? I have tried
> >> > to
> >> > do
> >> > this but it does not work either...

>
>
>

Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:41 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Changing data types

Sorry, I don't understand the message. It seems to say something about an
operator being incorrect; something is wrong with the bang or dot perhaps.

Open the Immediate Window (Ctrl+G)
Paste this in, and press enter:
? DateSerial(20060123 \ 10000, (20060123 \100) Mod 100, 20060123 Mod
100)
Does the expression return the date correctly?

Presumably Consegna is the name of the Long Integer field in table jhmc1.

Is your list separator different? Do you use a dot or semicolon to separate
items in the list? If so, you might need to replace the commas in the
expression with your list separator.

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

"Andreas" wrote in message
news:ACBB6504-8753-40DB-908E-49B0709B8723@microsoft.com...
> It happens in the step when I write the code in the update field. Have I
> understood it right. I have two fields in my new question. On with the old
> date-field that is called Consegna here, There I write the criteria. Then
> I
> have a new field with the new date-field called date here. Then I write
> the
> text you gave me in the update field in field called date. The message
> comes
> when I want to confirm the written text in the field by ´leaving the
> field.
> So it is not possible to change to SQL-view without erasing the text that
> you
> gave me. But if I erase it the sql says:
>
> Update jhmc1 SET
> Where (((jhmc1.Consegna) Between 19000101 And 29990101
>
> That's it, but their is no problem so far as I said, it is when I type the
> text you gave me in step 7 the problems start!
>
> Thanks
>
> "Allen Browne" skrev:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
>
>> Perhaps someone who reads Italian can help.
>>
>> At what step does it happen?
>> If it is in the query, switch your query to SQL View, and paste the SQL
>> statement here. We might be able to see from that what's going on.
>>
>> If you have spaces or other odd characters in your table/field names,
>> enclose them in square brackets.
>>
>> "Andreas" wrote in message
>> news:9ED91745-891E-4A86-8AAA-ECEC424EB9D8@microsoft.com...
>> > Thanks for your help
>> >
>> > But I am getting the message below when I do this. Unfortunately it is
>> > in
>> > Italian:
>> >
>> > "Operatore punto (.) o punto esclamativo (!) non valido oppure
>> > parentesi
>> > non
>> > valide nell espressione"
>> >
>> > "Puo esser stato immesso un identificatore non valido o possono essere
>> > state
>> > digitate delle parentesi dopo la costante null"
>> >
>> > Does this tell you anything even if it is in Italian?
>> >
>> > /andreas
>> >
>> > "Allen Browne" skrev:
>> >
>> >> Here is a safe approach:
>> >>
>> >> 1. Open your table in design view.
>> >>
>> >> 2. Add a new field of Date/Time to accept the real date.
>> >>
>> >> 3. Save. Close the table.
>> >>
>> >> 4. Create a query using this table.
>> >>
>> >> 5. Change it to an Update query (Update on Query menu.)
>> >>
>> >> 6. Drag the existing number date (named "d" in this example) into the
>> >> grid.
>> >> In the Criteria row, enter:
>> >> Between 19000101 And 29990101
>> >> so that nulls and shorter/longer numbers are excluded.
>> >>
>> >> 7. Drag the new date field (created at step 2) into the grid.
>> >> In the Update row under this query, enter:
>> >> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
>> >> replacing d with the name of your field.
>> >>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
>> >> 8. Test that the results are right.
>> >> Then delete the old Number field from your table.
>> >>
>> >> How it works:
>> >> DateSerial() builds a date from year, month, day.
>> >> The integer division (\ operator) and left-over (mod operator) get
>> >> these
>> >> values from the number.
>> >>
>> >> It is also possible to parse the numbers with string operators such as
>> >> Left(), Mid() and Right(), but the numeric operators would be more
>> >> efficient.
>> >>
>> >> "Andreas" wrote in message
>> >> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
>> >> >I have a field called "date" which contains 250 000 rows. It contins
>> >> >dates
>> >> >in
>> >> > the yyyymmdd form. However, it has the data type "numbers". i would
>> >> > like
>> >> > to
>> >> > change this to the data type "date/time" but when I do this all the
>> >> > information just disappears. Why? Do I have to change the yyyymmdd
>> >> > to
>> >> > one
>> >> > of
>> >> > the given types, for example, the yyyy-mm-dd form first? I have
>> >> > tried
>> >> > to
>> >> > do
>> >> > this but it does not work either...



Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:41 AM
Andreas's Avatar Andreas
Guest
 
Posts: n/a
   
   
Re: Changing data types

When I put the string in the immediate window an error message show up. It
says (sorry, same language as before)

"errore di compilazione" (Some kind of error)
"Previsto: Separatore di elenco oppure(Anticipate: Separate Otherwise List,
directly translated )

Due to my rather weak English I do not understand your last point, but I do
not have any commas etc in the consegna-field, however I do have another
field (addresses) where commas may appear.

I hope you have time to help me again I would appreciate it a lot

Andreas

"Allen Browne" skrev:

> Sorry, I don't understand the message. It seems to say something about an
> operator being incorrect; something is wrong with the bang or dot perhaps.
>
> Open the Immediate Window (Ctrl+G)
> Paste this in, and press enter:
> ? DateSerial(20060123 \ 10000, (20060123 \100) Mod 100, 20060123 Mod
> 100)
> Does the expression return the date correctly?
>
> Presumably Consegna is the name of the Long Integer field in table jhmc1.
>
> Is your list separator different? Do you use a dot or semicolon to separate
> items in the list? If so, you might need to replace the commas in the
> expression with your list separator.
>
> --
> 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.
>
> "Andreas" wrote in message
> news:ACBB6504-8753-40DB-908E-49B0709B8723@microsoft.com...
> > It happens in the step when I write the code in the update field. Have I
> > understood it right. I have two fields in my new question. On with the old
> > date-field that is called Consegna here, There I write the criteria. Then
> > I
> > have a new field with the new date-field called date here. Then I write
> > the
> > text you gave me in the update field in field called date. The message
> > comes
> > when I want to confirm the written text in the field by ´leaving the
> > field.
> > So it is not possible to change to SQL-view without erasing the text that
> > you
> > gave me. But if I erase it the sql says:
> >
> > Update jhmc1 SET
> > Where (((jhmc1.Consegna) Between 19000101 And 29990101
> >
> > That's it, but their is no problem so far as I said, it is when I type the
> > text you gave me in step 7 the problems start!
> >
> > Thanks
> >
> > "Allen Browne" skrev:
> >
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> >> Perhaps someone who reads Italian can help.
> >>
> >> At what step does it happen?
> >> If it is in the query, switch your query to SQL View, and paste the SQL
> >> statement here. We might be able to see from that what's going on.
> >>
> >> If you have spaces or other odd characters in your table/field names,
> >> enclose them in square brackets.
> >>
> >> "Andreas" wrote in message
> >> news:9ED91745-891E-4A86-8AAA-ECEC424EB9D8@microsoft.com...
> >> > Thanks for your help
> >> >
> >> > But I am getting the message below when I do this. Unfortunately it is
> >> > in
> >> > Italian:
> >> >
> >> > "Operatore punto (.) o punto esclamativo (!) non valido oppure
> >> > parentesi
> >> > non
> >> > valide nell espressione"
> >> >
> >> > "Puo esser stato immesso un identificatore non valido o possono essere
> >> > state
> >> > digitate delle parentesi dopo la costante null"
> >> >
> >> > Does this tell you anything even if it is in Italian?
> >> >
> >> > /andreas
> >> >
> >> > "Allen Browne" skrev:
> >> >
> >> >> Here is a safe approach:
> >> >>
> >> >> 1. Open your table in design view.
> >> >>
> >> >> 2. Add a new field of Date/Time to accept the real date.
> >> >>
> >> >> 3. Save. Close the table.
> >> >>
> >> >> 4. Create a query using this table.
> >> >>
> >> >> 5. Change it to an Update query (Update on Query menu.)
> >> >>
> >> >> 6. Drag the existing number date (named "d" in this example) into the
> >> >> grid.
> >> >> In the Criteria row, enter:
> >> >> Between 19000101 And 29990101
> >> >> so that nulls and shorter/longer numbers are excluded.
> >> >>
> >> >> 7. Drag the new date field (created at step 2) into the grid.
> >> >> In the Update row under this query, enter:
> >> >> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
> >> >> replacing d with the name of your field.
> >> >>
> >> >> 8. Test that the results are right.
> >> >> Then delete the old Number field from your table.
> >> >>
> >> >> How it works:
> >> >> DateSerial() builds a date from year, month, day.
> >> >> The integer division (\ operator) and left-over (mod operator) get
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> >> >> these
> >> >> values from the number.
> >> >>
> >> >> It is also possible to parse the numbers with string operators such as
> >> >> Left(), Mid() and Right(), but the numeric operators would be more
> >> >> efficient.
> >> >>
> >> >> "Andreas" wrote in message
> >> >> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
> >> >> >I have a field called "date" which contains 250 000 rows. It contins
> >> >> >dates
> >> >> >in
> >> >> > the yyyymmdd form. However, it has the data type "numbers". i would
> >> >> > like
> >> >> > to
> >> >> > change this to the data type "date/time" but when I do this all the
> >> >> > information just disappears. Why? Do I have to change the yyyymmdd
> >> >> > to
> >> >> > one
> >> >> > of
> >> >> > the given types, for example, the yyyy-mm-dd form first? I have
> >> >> > tried
> >> >> > to
> >> >> > do
> >> >> > this but it does not work either...

>
>
>

Reply With Quote
  #8 (permalink)  
Old 28-Jul-2006, 08:41 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Changing data types

Right, that error confirms that the list separator is the problem.

Open the Windows Control Panel
Choose Regional Options
Click the Customize button
The second last item is called:
List Separator

Use whatever character is in that box instead of the
,
in the date expression.

(The steps above are for Windows XP. Might be a different in other
versions.)

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

"Andreas" wrote in message
news:62595AD5-2C2D-4195-85FE-D481412C31F4@microsoft.com...
> When I put the string in the immediate window an error message show up. It
> says (sorry, same language as before)
>
> "errore di compilazione" (Some kind of error)
> "Previsto: Separatore di elenco oppure(Anticipate: Separate Otherwise
> List,
> directly translated )
>
> Due to my rather weak English I do not understand your last point, but I
> do
> not have any commas etc in the consegna-field, however I do have another
> field (addresses) where commas may appear.
>
> I hope you have time to help me again I would appreciate it a lot
>
> Andreas
>
> "Allen Browne" skrev:
>
>> Sorry, I don't understand the message. It seems to say something about an
>> operator being incorrect; something is wrong with the bang or dot
>> perhaps.
>>
>> Open the Immediate Window (Ctrl+G)
>> Paste this in, and press enter:
>> ? DateSerial(20060123 \ 10000, (20060123 \100) Mod 100, 20060123 Mod
>> 100)
>> Does the expression return the date correctly?
>>
>> Presumably Consegna is the name of the Long Integer field in table jhmc1.
>>
>> Is your list separator different? Do you use a dot or semicolon to
>> separate
>> items in the list? If so, you might need to replace the commas in the
>> expression with your list separator.
>>
>> --
>> 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.
>>
>> "Andreas" wrote in message
>> news:ACBB6504-8753-40DB-908E-49B0709B8723@microsoft.com...
>> > It happens in the step when I write the code in the update field. Have
>> > I
>> > understood it right. I have two fields in my new question. On with the
>> > old
>> > date-field that is called Consegna here, There I write the criteria.
>> > Then
>> > I
>> > have a new field with the new date-field called date here. Then I write
>> > the
>> > text you gave me in the update field in field called date. The message
>> > comes
>> > when I want to confirm the written text in the field by ´leaving the
>> > field.
>> > So it is not possible to change to SQL-view without erasing the text
>> > that
>> > you
>> > gave me. But if I erase it the sql says:
>> >
>> > Update jhmc1 SET
>> > Where (((jhmc1.Consegna) Between 19000101 And 29990101
>> >
>> > That's it, but their is no problem so far as I said, it is when I type
>> > the
>> > text you gave me in step 7 the problems start!
>> >
>> > Thanks
>> >
>> > "Allen Browne" skrev:
>> >
>> >> Perhaps someone who reads Italian can help.
>> >>
>> >> At what step does it happen?
>> >> If it is in the query, switch your query to SQL View, and paste the
>> >> SQL
>> >> statement here. We might be able to see from that what's going on.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
>> >>
>> >> If you have spaces or other odd characters in your table/field names,
>> >> enclose them in square brackets.
>> >>
>> >> "Andreas" wrote in message
>> >> news:9ED91745-891E-4A86-8AAA-ECEC424EB9D8@microsoft.com...
>> >> > Thanks for your help
>> >> >
>> >> > But I am getting the message below when I do this. Unfortunately it
>> >> > is
>> >> > in
>> >> > Italian:
>> >> >
>> >> > "Operatore punto (.) o punto esclamativo (!) non valido oppure
>> >> > parentesi
>> >> > non
>> >> > valide nell espressione"
>> >> >
>> >> > "Puo esser stato immesso un identificatore non valido o possono
>> >> > essere
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
>> >> > state
>> >> > digitate delle parentesi dopo la costante null"
>> >> >
>> >> > Does this tell you anything even if it is in Italian?
>> >> >
>> >> > /andreas
>> >> >
>> >> > "Allen Browne" skrev:
>> >> >
>> >> >> Here is a safe approach:
>> >> >>
>> >> >> 1. Open your table in design view.
>> >> >>
>> >> >> 2. Add a new field of Date/Time to accept the real date.
>> >> >>
>> >> >> 3. Save. Close the table.
>> >> >>
>> >> >> 4. Create a query using this table.
>> >> >>
>> >> >> 5. Change it to an Update query (Update on Query menu.)
>> >> >>
>> >> >> 6. Drag the existing number date (named "d" in this example) into
>> >> >> the
>> >> >> grid.
>> >> >> In the Criteria row, enter:
>> >> >> Between 19000101 And 29990101
>> >> >> so that nulls and shorter/longer numbers are excluded.
>> >> >>
>> >> >> 7. Drag the new date field (created at step 2) into the grid.
>> >> >> In the Update row under this query, enter:
>> >> >> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
>> >> >> replacing d with the name of your field.
>> >> >>
>> >> >> 8. Test that the results are right.
>> >> >> Then delete the old Number field from your table.
>> >> >>
>> >> >> How it works:
>> >> >> DateSerial() builds a date from year, month, day.
>> >> >> The integer division (\ operator) and left-over (mod operator) get
>> >> >> these
>> >> >> values from the number.
>> >> >>
>> >> >> It is also possible to parse the numbers with string operators such
>> >> >> as
>> >> >> Left(), Mid() and Right(), but the numeric operators would be more
>> >> >> efficient.
>> >> >>
>> >> >> "Andreas" wrote in message
>> >> >> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
>> >> >> >I have a field called "date" which contains 250 000 rows. It
>> >> >> >contins
>> >> >> >dates
>> >> >> >in
>> >> >> > the yyyymmdd form. However, it has the data type "numbers". i
>> >> >> > would
>> >> >> > like
>> >> >> > to
>> >> >> > change this to the data type "date/time" but when I do this all
>> >> >> > the
>> >> >> > information just disappears. Why? Do I have to change the
>> >> >> > yyyymmdd
>> >> >> > to
>> >> >> > one
>> >> >> > of
>> >> >> > the given types, for example, the yyyy-mm-dd form first? I have
>> >> >> > tried
>> >> >> > to
>> >> >> > do
>> >> >> > this but it does not work either...

>>
>>
>>



Reply With Quote
  #9 (permalink)  
Old 28-Jul-2006, 08:42 AM
Andreas's Avatar Andreas
Guest
 
Posts: n/a
   
   
Re: Changing data types

  Donate Today!  
Voila! Perfect! Thanks!
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883

But I tried everything on a copy of my originial table to be on the safe
side. I have a lot of questions and forms built up upon "consegna", how can I
make this change in the original table without affecting this?

Andreas



"Allen Browne" skrev:

> Right, that error confirms that the list separator is the problem.
>
> Open the Windows Control Panel
> Choose Regional Options
> Click the Customize button
> The second last item is called:
> List Separator
>
> Use whatever character is in that box instead of the
> ,
> in the date expression.
>
> (The steps above are for Windows XP. Might be a different in other
> versions.)
>
> --
> 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.
>
> "Andreas" wrote in message
> news:62595AD5-2C2D-4195-85FE-D481412C31F4@microsoft.com...
> > When I put the string in the immediate window an error message show up. It
> > says (sorry, same language as before)
> >
> > "errore di compilazione" (Some kind of error)
> > "Previsto: Separatore di elenco oppure(Anticipate: Separate Otherwise
> > List,
> > directly translated )
> >
> > Due to my rather weak English I do not understand your last point, but I
> > do
> > not have any commas etc in the consegna-field, however I do have another
> > field (addresses) where commas may appear.
> >
> > I hope you have time to help me again I would appreciate it a lot
> >
> > Andreas
> >
> > "Allen Browne" skrev:
> >
> >> Sorry, I don't understand the message. It seems to say something about an
> >> operator being incorrect; something is wrong with the bang or dot
> >> perhaps.
> >>
> >> Open the Immediate Window (Ctrl+G)
> >> Paste this in, and press enter:
> >> ? DateSerial(20060123 \ 10000, (20060123 \100) Mod 100, 20060123 Mod
> >> 100)
> >> Does the expression return the date correctly?
> >>
> >> Presumably Consegna is the name of the Long Integer field in table jhmc1.
> >>
> >> Is your list separator different? Do you use a dot or semicolon to
> >> separate
> >> items in the list? If so, you might need to replace the commas in the
> >> expression with your list separator.
> >>
> >> --
> >> 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.
> >>
> >> "Andreas" wrote in message
> >> news:ACBB6504-8753-40DB-908E-49B0709B8723@microsoft.com...
> >> > It happens in the step when I write the code in the update field. Have
> >> > I
> >> > understood it right. I have two fields in my new question. On with the
> >> > old
> >> > date-field that is called Consegna here, There I write the criteria.
> >> > Then
> >> > I
> >> > have a new field with the new date-field called date here. Then I write
> >> > the
> >> > text you gave me in the update field in field called date. The message
> >> > comes
> >> > when I want to confirm the written text in the field by ´leaving the
> >> > field.
> >> > So it is not possible to change to SQL-view without erasing the text
> >> > that
> >> > you
> >> > gave me. But if I erase it the sql says:
> >> >
> >> > Update jhmc1 SET
> >> > Where (((jhmc1.Consegna) Between 19000101 And 29990101
> >> >
> >> > That's it, but their is no problem so far as I said, it is when I type
> >> > the
> >> > text you gave me in step 7 the problems start!
> >> >
> >> > Thanks
> >> >
> >> > "Allen Browne" skrev:
> >> >
> >> >> Perhaps someone who reads Italian can help.
> >> >>
> >> >> At what step does it happen?
> >> >> If it is in the query, switch your query to SQL View, and paste the
> >> >> SQL
> >> >> statement here. We might be able to see from that what's going on.
> >> >>
> >> >> If you have spaces or other odd characters in your table/field names,
> >> >> enclose them in square brackets.
> >> >>
> >> >> "Andreas" wrote in message
> >> >> news:9ED91745-891E-4A86-8AAA-ECEC424EB9D8@microsoft.com...
> >> >> > Thanks for your help
> >> >> >
> >> >> > But I am getting the message below when I do this. Unfortunately it
> >> >> > is
> >> >> > in
> >> >> > Italian:
> >> >> >
> >> >> > "Operatore punto (.) o punto esclamativo (!) non valido oppure
> >> >> > parentesi
> >> >> > non
> >> >> > valide nell espressione"
> >> >> >
> >> >> > "Puo esser stato immesso un identificatore non valido o possono
> >> >> > essere
> >> >> > state
> >> >> > digitate delle parentesi dopo la costante null"
> >> >> >
> >> >> > Does this tell you anything even if it is in Italian?
> >> >> >
> >> >> > /andreas
> >> >> >
> >> >> > "Allen Browne" skrev:
> >> >> >
> >> >> >> Here is a safe approach:
> >> >> >>
> >> >> >> 1. Open your table in design view.
> >> >> >>
> >> >> >> 2. Add a new field of Date/Time to accept the real date.
> >> >> >>
> >> >> >> 3. Save. Close the table.
> >> >> >>
> >> >> >> 4. Create a query using this table.
> >> >> >>
> >> >> >> 5. Change it to an Update query (Update on Query menu.)
> >> >> >>
> >> >> >> 6. Drag the existing number date (named "d" in this example) into
> >> >> >> the
> >> >> >> grid.
> >> >> >> In the Criteria row, enter:
> >> >> >> Between 19000101 And 29990101
> >> >> >> so that nulls and shorter/longer numbers are excluded.
> >> >> >>
> >> >> >> 7. Drag the new date field (created at step 2) into the grid.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13883
> >> >> >> In the Update row under this query, enter:
> >> >> >> DateSerial([d] \ 10000, ([d] \100) Mod 100, [d] Mod 100)
> >> >> >> replacing d with the name of your field.
> >> >> >>
> >> >> >> 8. Test that the results are right.
> >> >> >> Then delete the old Number field from your table.
> >> >> >>
> >> >> >> How it works:
> >> >> >> DateSerial() builds a date from year, month, day.
> >> >> >> The integer division (\ operator) and left-over (mod operator) get
> >> >> >> these
> >> >> >> values from the number.
> >> >> >>
> >> >> >> It is also possible to parse the numbers with string operators such
> >> >> >> as
> >> >> >> Left(), Mid() and Right(), but the numeric operators would be more
> >> >> >> efficient.
> >> >> >>
> >> >> >> "Andreas" wrote in message
> >> >> >> news:C049AAF6-2A12-401D-8788-A2CF54B42565@microsoft.com...
> >> >> >> >I have a field called "date" which contains 250 000 rows. It
> >> >> >> >contins
> >> >> >> >dates
> >> >> >> >in
> >> >> >> > the yyyymmdd form. However, it has the data type "numbers". i
> >> >> >> > would
> >> >> >> > like
> >> >> >> > to
> >> >> >> > change this to the data type "date/time" but when I do this all
> >> >> >> > the
> >> >> >> > information just disappears. Why? Do I have to change the
> >> >> >> > yyyymmdd
> >> >> >> > to
> >> >> >> > one
> >> >> >> > of
> >> >> >> > the given types, for example, the yyyy-mm-dd form first? I have
> >> >> >> > tried
> >> >> >> > to
> >> >> >> > do
> >> >> >> > this but it does not work either...
> >>
> >>
> >>

>
>
>

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 335 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,038 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 81 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 116 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 229 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 44 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 414 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 09:46 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.85184 seconds with 30 queries